next up previous index
Next: Hello World Example Up: Widgets Previous: Widget Names

Widget Types

  In this section we very briefly describe the main widget types available in Tk.

Frame  
is a widget which is used either to display a rectangle in a particular way (e.g. to create a frame border on a window), or to pack together several other widgets, usually because of the geometry manager.

Buttons  
There are several button types: normal buttons, radiobuttons (one can select at most one button out of several ones) and checkbuttons (each of them may be or on off). When a button is pressed, a user-specified command or command script is being executed.

Listbox  
contains a number of text lines, each of which can be selected to invoke a specified command.

Scrollbar  
is the usual widget to move the displayed area horizontally or vertically. It can be added to other widgets like listboxes, canvases etc.

Canvas  
displays graphical items, i.e. lines, curves, text, pictures etc. Each of the displayed items is an object on its own and commands or bindings can be attached to it.

Text  
displays text and embedded windows and offers a wide range of functions to manipulate it.

Menus  
offer the usual menu functionality, including pop-up menus.

Entry  
is a simple text item to type input text.

Label  
stores a given message in a specified size and font or a picture.

Message  
is like a label, but allows to display multiline text.

Scale  
displays a numerical value and allows the user to change it by dragging.

Toplevel  
is a stand-alone toplevel window which is managed   by the X11 window manager. Usually it is a container for the application widgets.

All widget types are shown in the Tk demo program, which can be invoked e.g. by

lyra% wish
% source $tk_library/demos/widget


next up previous index
Next: Hello World Example Up: Widgets Previous: Widget Names



Micha Meier
Tue Jul 2 09:49:39 MET DST 1996