A widget which can be used to direct the
user to a www URL.
Synopsis
gnocl::linkButton [-option value...]
Screenshot
Options- -active boolean
-
This option sets the widget active. Since one button of the group
must be active, a button can only set to non active by setting
another button to active. This overrides the value of the associated
variable. The associated variable is set accordingly.
- -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.
-
-indicatorOn boolean (default: true)
-
Determines whether or not the toggle button is drawn on screen
-
-name string
-
Name of the widget, can be used to set options in an rc file.
-
-onClicked 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 %u uri
- -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
- -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"
- -relief one of normal, half or none (default: normal)
-
Relief of the button.
-
-sensitive boolean (default: 1)
-
Whether or not the item is sensitive to user input.
-
-text string
-
Text of the button. If this option is set, then the button will not
display the uri.
-
-tooltip string
-
Message that appear next to this widget when the mouse pointer is
held over it for a short amount of time.
-
-uri string
-
The uri that the widget is linked to. This value needs to be set for
the widget to function properly. If the -text option is also set,
then the widget will display the text, yet still link to the
specified uri.
-
-variable string
-
NOTE: Required option.
-
-visible boolean (default: 1)
-
Whether or not the item is visible.
Description
The gnocl::linkButton provides a UI hyperlink, similar to the one
used by web browsers, which triggers an action when clicked. It is useful
to show quick links to resources.
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 script.
-
id onClicked
-
Executes the command given by the -onToggled option of the active
item in the group.
Exampleset box [gnocl::box]
set but5 [gnocl::linkButton \
-uri www.bbc.co.uk \
-onClicked {eval exec firefox %u &}]]
set but6 [gnocl::linkButton \
-uri www.bbc.co.uk \
-text HOMEPAGE \
-onClicked {eval exec firefox %u &}]]
$box add [list $but5 $but6 ]
|