A widget displays a mnemonic label.
Synopsis
gnocl::accelarator [-option value]
Screenshot
Options
- -align one of
topLeft, top, topRight, left, center, right, bottomLeft, bottom, or
bottomRight
-
Alignment of the text.
-
-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.
-
-justify one of left, right, center or fill (default: left)
-
Determines the justification of the text lines. Has no effect if the
label has only one line of text.
- -text string (defautl:"")
- The string to display as a message
in the menumonic label. The accelerator letter is nominated by prefixing with an underscore: i.e "_Apple".
- -widget string (defautl:"")
- The widget-id of the object to be
activitate upon inpute of the accelerator mnemonic.
- -name string (defautl:"")
- Name of the widget, can be used to
set options in an rc file.
- -data string (defautl:"")
- User defined data which can be
retrieved via the cget subcommand.
- -tooltip string (defautl:"")
- Message that appear next to this
widget when the mouse pointer is held over it for a short amount of
time.
-
-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
- This widget displays an accelerator label. When used in
connection with other widget, entry of the acceleration keyboard
sequence will activate that widget.
Commands
id cget
option
-
Returns the value for one option. The option may have any of the
values accepted by configure.
- id class
- Return the class for this widget
object, i.e. 'accelerator'.
-
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.
Example
#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"
package require Gnocl
proc ent {txt} {
set box [gnocl::box]
set ent [gnocl::entry]
set acc [gnocl::accelarator -text $txt -widget $ent -widthGroup A -align left]
$box add [list $acc $ent]
return $box
}
set container [gnocl::box -orientation vertical]
foreach item [list _Apple Ba_nnana C_herry] {
$container add [ent $item]
}
gnocl::window -child $container -onDestroy exit
gnocl::mainLoop
|
|