Documentation‎ > ‎Toplevel Windows‎ > ‎

    gnocl::colorSelection

    A standard dialogue to choose a colour.

    Synopsis

    colorSelection [-option value...]

    Screenshot

    Options

    -title
    type: string (default: "")
    Title of the colorSelection.
    -modal
    type: boolean (default: 0)
    Whether the window is modal, i.e. it grabs all GTK+ events. If the dialogue is created modal, the command returns the chosen colour as list of rgba values or the empty string instead of the usual widget ID.
    -palette
    type: boolean (default: 1)
    Whether the dialog has a palette.
    -opacity
    type: boolean (default: 0)
    Whether the dialog has a control for opacity.
    -color
    type: color
    Default colour for the dialogue.
    -alpha
    type: integer
    Default alpha value.
    -onClicked
    type: string (default: "")
    Command to be executed in the global scope if the Ok or Cancel button is chosen. Before evaluation the following percent strings are substituted:
    %w    widget name
    %x    button chosen: OK or CANCEL
    %r    red value
    %g    green value
    %b    blue value
    %a    alpha value
    -visible
    type: boolean (default: 1)
    Whether or not the item is visible.
    -name
    type: string
    Name of the widget, can be used to set options in an rc file.
    -onDestroy
    type: string (default: "")
    Tcl command which is executed if the widget is destroyed. Before evaluation the following percent strings are substituted:
    %w    widget name

    Description

    A colorSelection is used to let the user choose a colour in a standardized way. If the dialogue is created modal, the commands returns a list of the red, blue, green and alpha, or the empty string if Cancel is chosen. Otherwise it returns a widget ID in the usual way. The files and buttons chosen can be retrieved via the onClicked command.

    Commands

    id delete
    Deletes the widget and the associated tcl command.
    id configure [-option value...]
    Configures the widget. Option may have any of the values accepted on creation of the widget.

    Example

    set color [gnocl::colorSelection \
        -title "Please choose a color" \
        -modal 1 \
        -color lightblue]

    results in



    Comments

    Sections