1. Gui Reference
Option reference for Gui layout elements.
1.1 Gui Options
Option for the gui command
| Option | Default | Description | Args |
| autoname | True | Auto name items using lower case of command |
| command | | Callback handler | -type {cmd guiobj id optpairs} |
| file | | File to read value for -gui from |
| frame | | The parent frame to layout within |
| gui | | The gui layout |
| icfg | | Internal config |
| object | | TOD object (ie. -variable and -command are the same) |
| parent | | The parent window of this layout |
| prefix | | String to add to begining of variables v,/w, |
| values | | Set of name/value pairs to initialize id's with |
| variable | | Variable to set v,/w etc in |
1.2 Widget Elements
Following are the gui element tags that create widget windows
| Element | Description |
| Barchart | The blt barchart widget |
| Bargraph | The blt bargraph widget. |
| Button | The Tk button widget |
| Canvas | The Tk canvas widget |
| Canvas3d | The 3d canvas extension (requires the Canvas3d extension). |
| Checkbutton | The Tk checkbutton widget |
| Container | The blt container widget |
| Dial | The vu dial widget. |
| Entry | The Tk entry widget |
| Frame | The Tk frame widget |
| Graph | The blt graph widget |
| Gridable | Render a table using grid (warning this is a tcl-extension). |
| Htext | The blt container widget |
| Label | The Tk label widget |
| Labelframe | The Tk labelframe widget |
| Listbox | The Tk listbox widget |
| Menubutton | The Tk menubutton widget |
| Message | The Tk message widget |
| Notetab | Render a notetab using buttons (warning this is a tcl-extension). |
| Panedwindow | The Tk panedwindow widget |
| Pie | The vu bargraph widget. |
| Radiobutton | The Tk radiobutton widget |
| Scale | The Tk scale widget |
| Scrollbar | The Tk scrollbar widget |
| Spinbox | A spinbox entry widget |
| Stripchart | The blt stripchart widget |
| Table | The tktable widget. |
| Tabset | The blt tabset widget |
| Tabular | Render a table inside a Tk text widget (warning this is a tcl-extension). |
| Text | The Tk text widget |
| Toplevel | The Tk toplevel widget |
| TreeView | The blt treeview widget |
| TreeCtrl | A complex tree widget |
| grid | Layout rows of elements. |
| statusbar | Create a statusbar at the bottom of the toplevel. |
| tk | Eval inline tcl/tk code after substituting %W and %_. |
Gui also supports the Ttk widgets:
| Element | Description |
| TButton | The Tk button widget |
| TCheckbutton | The Tk checkbutton widget |
| TFrame | The Tk frame widget |
| TLabel | The Tk label widget |
| TLabelframe | The Tk labelframe widget |
| TMenubutton | The Tk menubutton widget |
| TPanedwindow | The Tk panedwindow widget |
| TRadiobutton | The Tk radiobutton widget |
| TScale | The Tk scale widget |
| TScrollbar | The Tk scrollbar widget |
| TSpinbox | A spinbox entry widget |
| TProgressbar | The progressbar widget |
| TCombobox | The combobox widget. |
| TNotebook | The blt tabset widget |
| TSizegrip | Size griper. |
| TSeparator | The separator widget |
| Treeview | The treeview widget |
1.3 Non-Widget Elements
Following are the non-window gui element tags
| Element | Description |
| Menu | Layout a menu (note uses "Menu attributes") . |
| configure | Configure a gui option. |
| include | Include a file and process as a gui. |
| style | Set style to use for toplevel. |
| wm | Eval the tk [wm] command. |
1.4 Sub-elements (Items)
Some elements take sub-items. Here are just a few:
| Sub-Element | Description |
| row | A row in a grid |
| tab | A tab in a tabset/notebook |
| pane | A pane in a panedwindow |
| x | Leave an empty cell in a grid or command in a Menu. |
1.5 Element Attributes
General attribute options available for most layout elements.
Note, use the Guild user interface to find the exact attributes
available for a tag.
| Option | Default | Description | Args |
| # | | A comment attribute |
| -cbopts | | Exta options to include in callback -x option (eg. % bind) |
| -conf | | Configuration options passed directly to widgets at creation. | -label {Widget Options} |
| -default | | Default string to initialize widgets data variable with. | -label Initializer |
| -dynamic | 0 | Defer layout until child-window is mapped (for frame, tabset, etc). 2 means relayout every time window is mapped |
| -focus | False | Request focus at end of layout |
| -hide | False | Created item is initially hidden |
| -gid | | Group identifier for use with style |
| -id | | Identifier for use by style and variable name |
| -init | | An init msg to call, results are used to set label |
| -key | | One or more keyboard shortcuts to invoke msg for widget |
| -label | | Text label for shortform displays |
| -matte | | Make the containing frame appear matted (raised and inset) |
| -mc | True | Do msgcat 'mc' translation (eg. buttons, listbox items, etc) |
| -msg | | Messsage to generate (ie. for bind, -command, etc) |
| -name | | Name of item to override 'id' for item variable eg. for radiobutton |
| -pad | 0,0,0,0 | Padding for pack (1 to 4 values: x,y external then x,y internal). |
| -pos | | Positioning of widget. One or more of letters in 'newsltbr|_+@X,y#W,H' |
| -posopts | | Options to pass directly to position manager pack/place/grid |
| -scroll | | Scrollbar positions. eg: 'ne', 'sw' and 'w*' |
| -style | | Style to apply |
| -subattr | | Arguments for all child widgets to inherit |
| -subconf | | Conf for all child widgets to inherit |
| -subgid | | Make all child widgets members of group |
| -subpos | | Positioning for child widgets (eg of frame, grid, etc) |
| -tip | | A tooltip or balloon string |
| -useid | | Use body from element with given id |
| -value | | Value for item |
1.6 Menu Element Attributes
Attribute for the "Menu" element. OBSOLETE
| Option | Default | Description | Args |
| A | | The -accelerator option, ie. do not use bind. |
| K | | Key string for the -accelerator, binding to toplevel. |
| a | | Arguments to append after the nscmd. |
| c | | Command to return dynamic menu options. |
| d | | Data variable containing menu options. |
| f | | Font to use for menu item. |
| g | | Image file to use as -compound (if Tk > 8.3). |
| h | | Image file to use instead of text. |
| i | | Inherited attrs for child menu elements. |
| k | | Key string for the -accelerator option. |
| l | | Label to use. |
| m | | The menu for a cascade. |
| n | | Namespace in which to handle msg |
| o | | Raw menu option string to inline. |
| p | | For menus, msg to invoke on each post. |
| s | | Subcommand to override the menu string. |
| u | | Explicit value for the -underline option. |
| v | | Variable for the -variable option. |
| w | n | Append the window path to callback. |
| x | 1 | Label should use msgcat. |
1.7 Pos Options
General options for the "pos" and "subpos" attributes.
Mostly these are used with the default pack/place managers.
| Option | Translation | Description |
| ¡ | -expand y | Expand to fill available space |
| # | | Option for setting width width,height eg: #200,400 or #0.3,0.3 |
| * | -fill both -expand y | Fill all space and expand. Same as +¡ |
| + | -fill both | Fill both vertically and horizontally |
| | A toplevel menu |
| @ | | Use 'place' with absolute or relative. eg: @200,400 or @0.1,0.2 |
| ^ | | A pop-up menu or programatically placed window |
| _ | -fill x | Fill horizontally |
| | | -fill y | Fill vertically |
| b | -side bottom | Pack against bottom |
| l | -side left | Pack against right |
| r | -side right | Pack against left |
| t | -side top | Pack against top |
| n | -anchor n | Anchor against top |
| e | -anchor e | Anchor against left |
| s | -anchor s | Anchor against bottom |
| w | -anchor w | Anchor against right |
1.8 Grid-Pos Options
Options for "pos" when used within the "grid" element.
| Option | Translation | Description |
| | | ns | Sticky top/bottom |
| _ | ew | Sticky left/right |
| * | news | Sticky in all directions and expand |
| ¡ | | Expand to fill available space |
| c | c | Centered spacing in available space |
| t | n | Sticky top |
| b | s | Sticky bottom |
| r | e | Sticky right |
| l | w | Sticky left |
| n | n | Anchor at north |
| s | s | Anchor at south |
| e | e | Anchor at east |
| w | w | Anchor at west |
| # | | Option for setting width,height eg: #200,400 |
1.9 Event Options
Event elements that are passed in opts parameter to event handler.
| Option | Translation | Description |
| args | | Arguments |
| button | %b | The mouse button number substitution |
| cmd | | The item command name from layout |
| coords | %X,%Y | The root window x,y coordinates of event |
| default | | User data to include with event (from layout default) |
| extra | | Extra % substitutions to include (from layout cbopts) |
| groups | | The value of -parent |
| id | | The user assigned item name (ie. the layout id) |
| init | | Unique layout item index |
| key | %A | The unicode character substitution |
| keysym | %K | The key symbol substitution (eg 'Return') |
| label | | The label (eg. for buttons) |
| tod | | Gui object or value of _ |
| path | | The path. eg. 'menu/File/Open' |
| pcmd | | The parent command item to this item |
| pclass | | The Tk class of pcmd |
| tkwin | %W | The Tk window substitution |
| value | | Value part from name/value of gui layout |
| win | | The gui window that received event |
1.10 Scroll Options
Options for "scroll" attribute which controls the position of scrollbars
| Option | Description |
| e | Right scrollbar |
| n | Top scrollbar |
| * | Automatically create destroy scrollbars as needed |
| w | Left scrollbar |
| s | Bottom scrollbar |
| + | Bind alt-pageup/pagedown/end to dynamically change scrollbars |
| # | For scrollframe (text widget in a canvas), adjust size of text widget |
© 2008 Peter MacDonald