II. GUI Basics
Chapter 6. Widgets - Using Widgets to Create Interfaces
Widget
Widget Control plays two roles in your presentation design: widget to create containers, and a widget to represent a
static background text for things such as instructions, labels for images or picture-style command buttons, page titles and
so on.
Widget as a container. A Bambookit widget container is a rectangular-shaped widget that holds one or more other widgets. Containers
can hold interacive elements, such as buttons and fields, and even other containers. There is no limit to the amount of container
nesting you can deploy. Most typically, however, you use a container to associate widgets in a unified group - whether that
group is based on funcionality or simply geographical convinience on the screen.
XML Element Name
- <Widget>
- <Widget/>
- </Widget>
Example
Two nesting widegts are created. First widget has size set to: width=200, height=100. The second widget has location specified
relative to the first widget with x=5, y=5, and width=190, height=90. The minimum that you have to specify to create a widget is setShape.
setBorder was set to make the widgets visible because setBorder default equals 'none'.
- <Widget setSize="200,100" setBorder="flat">
- <Widget setShape="5,5,190,90"/>
- </Widget>
Widget as a static text. A static text box is designed strictly for authoring convenienc: it is text box widget that
behave like label text.
XML Element Name
- <Widget/>
Examples
The widget displaying static text 'Hello World' is created.
- <Widget setSize="200,100" setLabel="Hello World"/>
Widget's methods
Basic set of methods that applies to all widgets is described in the Chapter 9 for widgets styles, and Chapter 10
for widgets attributes. For event handling methods please refer to Chapter 12.
Back
Next