Documentation‎ > ‎Containers‎ > ‎

    gnocl::eventBox

    A widget which catches events for its child widget.

    Synopsis

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

    Screenshot


    Options

    -backgroundtype: color
    Background colour of the widget.
    -childwidget-ID
    Widget ID of the child.
    -dragTargets list of strings
    List of source targets (e.g. text/plain or application/x-color) which are supported.
    -dropTargets list of strings
    List of destination targets (e.g. text/plain or application/x-color) which are supported.
    -onEnter string (default "")

    Tcl command which is executed whenever the mouse pointer enters the displayed area of the gnocl::eventBox container.

    %w    widget name.
    %x     widget x coordinate
    %y     widget y coordinate .
    %X    display x coordinate
    %Y    display y coordinate
    %s    state of keyboard buttons
    %g    widget glade name

    -onLeave string (default "")

    Tcl command which is executed whenever the mouse pointer enters the displayed area of the gnocl::eventBox container.

    %w    widget name.
    %x     widget x coordinate
    %y     widget y coordinate .
    %X    display x coordinate
    %Y    display y coordinate
    %s    state of keyboard buttons
    %g    widget glade name
    -hasFocus 1
    This sets the focus to the widget. To unset the focus it must be set to another widget.
    -heightGroup string (default: "")
    heightGroup 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 string
    Name of the widget, can be used to set options in an rc file.
    -onButtonPress 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 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)
    -onDestroy string (default: "")
    Tcl command which is executed if the widget is destroyed. Before evaluation the following percent strings are substituted:

    %w    widget name
    -onDragData string (default: "")
    Tcl command which is executed if data is draged from this the widget to another. This command must return the data to be draged. Before evaluation the following percent strings are substituted:

    %w    widget name
    %t    time
    %T    type of data
    -onDropData string (default: "")
    Tcl command which is executed if data is dropped on the widget. Before evaluation the following percent strings are substituted:

    %w    widget name
    %d    data
    %l    length of data
    %t    time
    %T    type of data
    %x    x coordinate
    %y    y coordinate
    -onMotion string (default: "")
    Tcl command which is executed if the mouse is moved inside the widget. Before evaluation the following percent strings are substituted:

    %w    widget name
    %x    x coordinate
    %y    y coordinate
    %s    state of the buttons and modifiers (bitmask)
    -onPopupMenu 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
    -onShowHelp 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"
    -sensitive boolean (default: 1)
    Whether or not the item is sensitve to user input.
    -sizeGroup 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 string (default: "")
    Title of the window.
    -tooltip string
    Message that appear next to this widget when the mouse pointer is held over it for a short amount of time.
    -visible boolean (default: 1)
    Whether or not the item is visible.
    -widthGroup string (default: "")
    The -widthGroup opion 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

    Some widgets like label do not have an own window. This means that they cannot catch events and cannot set their background colour. If put inside an gnocl::eventBox the latter can handle all these tasks.

    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.
    id cget option
    Returns the value for one option. The option may have any of the values accepted by configure.

    Example

    set label [gnocl::label \
        -text "Some text"]

    set box [gnocl::eventBox \
        -child $label \
        -tooltip "Helpful hint" \
        -background lightblue]

    gnocl::window \
        -title "EventBox" \
        -child $box


    Comments

    Sections