Documentation‎ > ‎Chooser Buttons‎ > ‎

    gnocl::colorButton

    A button to launch a colour selection dialogue.

    Synopsis

    gnocl::colorButton [-option value...]

    Screenshot

    Options

    -alpha
    type: integer
    Alpha value to be used
    -color
    type: color 
      Colour to be used.
    -data
    type: string
    User defined data which can be retrieved via the cget subcommand.
    -hasFocus
    type: 1
    This sets the focus to the widget. To unset the focus it must be set to another widet.
    -heightGroup
    type: string (default: "")
    The -heightGroup option can be an arbitrary string. All widgets with the same heightGroup request the same height. If packed with the fill flag set, they will have nevertheless different heights.
    -name
    type: string
    Name of the widget, can be used to set options in an rc file.
    -onButtonPress
    type: string (default: "")
    Tcl command which is executed if a mouse button is press inside the widget. Before evaluation the following percent strings are substituted:
    %w    widget name
    %t    type of event: one of buttonPress, button2Press or button3Press
    %x    x coordinate
    %y    y coordinate
    %b    button number
    %s    state of the buttons and modifiers (bitmask)
    -onButtonRelease
    type: string (default: "")
    Tcl command which is executed if a mouse button is released inside the widget. Before evaluation the following percent strings are substituted:
    %w    widget name
    %t    type of event: always buttonRelease
    %x    x coordinate
    %y    y coordinate
    %b    button number
    %s    state of the buttons and modifiers (bitmask)
    -onClicked
    type: string (default: "")
    Tcl command which is executed if the button is clicked. Before evaluation the following percent strings are substituted:
    %w    widget name
    -onPopupMenu
    type: string (default: "")
    Tcl command which is executed if the "popup-menu" signal is received, which is normally the case if the user presses Shift-F10. Before evaluation the following percent strings are substituted:
    %w    widget name
    -onRealize
    type: string (default: "")
    Tcl command which is executed in the global scope if the widget has been realized. Before evaluation the following percent strings are substituted:
    %w    widget name
    -onShowHelp
    type: string (default: "")
    Tcl command which is executed in the global scope if the "show-help" signal is received, which is normally the case if the user presses F1 or Ctrl-F1. Before evaluation the following percent strings are substituted:
    %w    widget name
    %h    help type: either "whatsThis" or "tooltip"

    -relief
    type: ONE OF normal, half or none (default: normal)
    Relief of the button.
    -sensitive
    type: boolean (default: 1)
    Whether or not the item is sensitive to user input.
    -sizeGroup
    type: string (default: "")
    The -sizeGroup option can be an arbitrary string. All widgets with the same sizeGroup request the same size. If packed with the fill flag set, they will have nevertheless different sizes.
    -title
    type: string
    Title of the font selection dialogue.
    -tooltip
    type: string
    Message that appear next to this widget when the mouse pointer is held over it for a short amount of time.
    -useAlpha
    type: bool (default: false)
    Whether to use the alpha value.
    -visible
    type: boolean (default: 1)
    Whether or not the item is visible.
    -widthGroup
    type: string (default: "")
    widthGroup can be an arbitrary string. All widgets with the same widthGroup request the same width. If packed with the fill flag set, they will have nevertheless different widths.

    Description

    A button widget which launches a color selection dialog. This command is available since GTK+ 2.4.

    Commands

    id cget option
    Returns the value for one option. The option may have any of the values accepted by configure.
    id configure [-option value...]
    Configures the widget. Option may have any of the values accepted on creation of the widget.
    id delete
    Deletes the widget and the associated Tcl command.
    id onClicked
    Executes the Tcl command associated with the button if there is one. This command is ignored if the button's state is not sensitive.

    Example

    set button [gnocl::colorButton \
        -title "Gnocl default color" \
        -color "DarkSeaGreen"]

    gnocl::window \
        -title "colorButton" \
        -child $button

    results in



    Comments

    Sections