Section 10.5. Widgets


[Page 385 (continued)]

10.5. Widgets

A widget is the term used to describe each individual component of an X window. Buttons, borders, and scrolling text boxes are all widgets. Each X toolkit can define its own set of widgets. Each desktop or window manager can provide its own widget set, but nearly all widget sets have a common set of core functions that are expected by computer users.

10.5.1. Menus

Menus provide GUI access to functions provided by the application. These functions are often those not directly related to the contents of any particular window (things like opening files, setting options, and exiting). Menu buttons are found along the top of a window. Figure 10-5 shows an example of a menu pulldown.

Figure 10-5. A menu pulldown.
(This item is displayed on page 386 in the print version)


10.5.2. Pushbuttons

Pushbuttons can be laid out in any fashion required by an application. The typical pushbutton example is the OK/Cancel dialog box (an additional window that pops up with new information or one that queries the user for more information). Figure 10-6 shows an example of a dialog box.

Figure 10-6. A dialog box with pushbuttons.
(This item is displayed on page 386 in the print version)


10.5.3. Check Boxes/Radio Buttons

Check boxes and radio buttons are both input-gathering widgets. A check box is a yes/no type of button. If checked, this item is true, yes, or present, depending on the context of the statement. Check boxes are usually square. Radio buttons are a collection of mutually exclusive selections; when one is selected, any others that were selected are deselected (like the buttons on a car radio). Radio buttons are usually round. Figure 10-7 shows an example of check boxes and radio buttons.


[Page 387]

Figure 10-7. Check boxes and radio buttons.


10.5.4. Scroll Bars

Scroll bars allow you to scroll back and forth in a window or a part of a window. This is often useful when a lot of text is involved but a short display area is available so not all the text fits. Scroll bars may be either horizontal or vertical. Vertical scroll bars are generally on the right side of a window (as in Figure 10-8). Horizontal scroll bars are usually along the bottom of a window.

Figure 10-8. A file browser window with a scroll bar.
(This item is displayed on page 388 in the print version)





Linux for Programmers and Users
Linux for Programmers and Users
ISBN: 0131857487
EAN: 2147483647
Year: 2007
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net