A widget, also known as a control, is a visual or layout component of a graphical user interface (GUI). Like most other GUI toolkits, Tk includes various widgets. Widgets may be organized into larger units called megawidgets.
- Accessible widgets
- An essential tool for creating widgets.
- Tk syntax help
- a list of Tk specific commands, some of which are widgets
- Blinking widgets
- Useful Tk Widgets
- Widget tags
A gadget is a slightly different thing:
EE: From The X Window System: Programming And Applications With Xt, OSF/Motif Edition by Douglas A. Young. (First edition, sixth printing, published in 1990):
- In addition to widgets, Motif provides a user interface component known as a gadget. Gadgets are identical to widgets, except that they have no window of their own. A gadget must display text or graphics in the window provided by its parent, and must also rely on its parent for input. [...] From the application programmer's viewpoint, gadgets can be used exactly the same way as other display widgets, except for the following restrictions. Gadgets cannot support event handlers, translations, or popup children. Gadgets can support callback functions and have the same appearance as the corresponding widgets.
DKF 2002-12-17: For a more modern example of the difference, Java Swing is almost entirely gadget-based, whereas AWT is pretty-much completely widget-based (though they use different terminology: lightweight and heavyweight Components.)
- a megawidget framework written by Jeff Hobbs.
- includes a widget module, also by Jeff Hobbs
Most widgets have some sort of graphical representation, but some, i.e. Tk's frame and labelframe, are containers, and are useful to achieve some desired layout.