Administration edit
Data edit
Dialogues edit
Event Management edit
Inter-Process Communication edit
Facilities edit
Fonts edit
Geometry edit
Control edit
- bell
- grab
- focus
- selection
- tk_focusNext
- tk_focusPrev
- tk_focusFollowsMouse
- tk_menuSetFocus
- palette
- tk_bisque
- tk_setPalette
- tk_textCopy
- tk_textCut
- tk_textPaste
Reference edit
ttk edit
In Tk 8.5, the Ttk package becomes a part of the Tk distribution. Special information on some of these tile/ttk widgets:Variables edit
Reserved variables are (incomplete):environment variables
There are also some environment variables.Widgets edit
- button
- canvas
- checkbutton
- entry
- frame
- label
- labelframe
- listbox
- menu
- menubutton
- message
- panedwindow
- radiobutton
- scale
- scrollbar
- spinbox
- text
- tk_optionMenu
- tk_popup
- toplevel
- all the Ttk commands
Additional Widgets edit
tklib's widget package contains the following megawidgets:- dialog
- (a)synchronous dialog shell with core dialog handling
- menuentry
- entry with dropdown menu
- panelframe
- ruler
- screenruler
- this is cool, really!
- scrolledwindow
- statusbar
- for easier handling of bottom status items, with corner resize control
- superframe
- toolbar
Window Management edit
Obsolete Widgets edit
** Internal Variables- ::tk::psglyphs
- ::tk::ps_preamble
- ::tk::AlwaysShowSelection
Internal Commands edit
- ::tk::ConsoleInvoke
- ::tk::ConsoleSource
- ::tk::ConsoleExit
- ::tk::ConsoleHistory
- ::tk::ensure_psenc_is_loaded
- an empty procedure that can be called to auto-load the postscript features of Tk
- ::tk::CreatePostscriptEncoding
- ::tk::ps::literal
- ::tk::ps::variable
- ::tk::ps::function
- ::tk::SetFocusGrab
- ::tk::RestoreFocusGrab
See Also edit
- megawidget
- Tcl syntax
- Widgets in the initial Tk package
- images of the various widgets.
- Tk glossary
- Explains some terms occurring in the manpages.
- widget
- general information widgets.
- Tk widget sticky discussion
Misc edit
Note that in Tk, one has several ways one can control visual aspects of widgets:- externally, via the X resource database
- at creation time, on the command line
- later, using the -config option
- via the option database
- in some cases, via special objects, like font
One must be certain to keep some things in mind when writing widget code:
- Widget names are generally a series of period separated names. [Can someone write more text here concerning the naming of widgets, naming hierarchy and what is for, how it contrasts with namespaces, etc.]
- If your widget names might have spaces in them, be certain to treat the names carefully, in particular when using eval, subst, etc.
- DKF writes in comp.lang.tcl:
- Jeff Hobbs writes in comp.lang.tcl:
interp alias {} foo::bar {} .top.frame1.bar.canvas
LV: So, if someone has a string that they are certain is a name of a widget, is there introspection that can be used to determine what widget it is?escargo 2005-08-16: I would expect winfo exists should be able to answer that question.LV: winfo exists just tells me if the widget exists - not what kind of a widget it is. Thanks!MG: How about winfo class $widgetName?LV: That seems like it should work - thanks!
RS 2006-04-28: Here's a little helper to retrieve the default value of a widget attribute (use long names (-background) instead of the short ones (-bg)):
% proc get'default {w flag} {lindex [$w config $flag] 3} % get'default $t -font {MS Sans Serif} 8The current value is of course returned by the cget method:
% $t cget -font Courier 9