Documentation‎ > ‎Buttons‎ > ‎

gnocl::arrowButton

A widget which displays a navigation arrow.

Synopsis

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

Screenshot

Options

-arrow  ONE OF up, down, left, right or none (default: down)
Background colour.
NOTE: The Gtk libraries which Gnocl interfaces do not provide functions for returning the arrow type of an arrow widget although this property can be modified. Later release of Gnocl may include some remedy for this shortfall so, in the meantime, should one wish to retrieve information regarding the widget arrow direction this can achieved using the -data <string>  option inherited from the button container for the arrow or by sending an additional argument to Tcl script executed. Both methods are illustrated in the following example:
proc callback { d } { puts "direction $d" }

set but8a [ gnocl::arrowButton \
    -arrow up \
    -data up \
    -shadow in \
    -onClicked { callback up" } ]

puts [$but8a cget -data]
-shadow ONE OF in, out, etchedIn, etechedOut or none (default: in)
Background colour.
NOTE: This feature is not fully implemented in the current version.
-activeBackgroundColor color
Background colour.
-data  string
User defined data which can be retrieved via the cget subcommand.
-hasFocus 1
This sets the focus to the widget. To unset the focus it must be set to another widget.
-heightGroup 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 string
Name of the widget, can be used to set options in an rc file.
-normalBackgroundColo color
Background colour.
-onClicked string (default: "")
Tcl script which is executed if the button is clicked.  Before evaluation the following percent strings are substituted:

%w    widget name

-onPopupMenu string (default: "")

Tcl script 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 string (default: "")

Tcl script 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 string (default: "")

Tcl script 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"

-prelightBackgroundColor color

Background colour.
-relief ONEOF normal, half or none (default: normal)
Relief of the button.
-sensitive boolean (default: 1)
Whether or not the item is sensitive to user input.
-sizeGroup string (default: "")
sizeGroup 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.
-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 option 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 widget which displays a navigation arrow.

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 box [gnocl::box]

set but1 [gnocl::arrowButton \
    -arrow up \
    -shadow in \
    -tooltip "Go Up" \
    -onClicked {puts "%w up arrowButton"}]

set but2 [gnocl::arrowButton \
    -arrow down -shadow in \
    -tooltip "Go Down" \
    -onClicked {puts "%w down arrowButton"}]

set but3 [gnocl::arrowButton \
    -arrow left \
    -shadow in \
    -tooltip "Go Left" \
    -onClicked {puts "%w left arrowButton"}]

set but4 [gnocl::arrowButton \
    -arrow right \
    -shadow in \
    -tooltip "Go Right" \
    -data right \
    -onClicked {puts "%w right arrowButton"}]

$box add [list $but1 $but2 $but3 $but4 ]

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


Comments