Bambookit Home    Bambookit GUI Tutorial

Back    Next   

II. GUI Basics

Chapter 6. Widgets - Using Widgets to Create Interfaces




Checkbox

Checkbox Widget. Caution is not to make series of check boxes operate like radio buttons. Check boxes let users to make independent choices: checking one box does not aotomatically uncheck all the others in a group. That't not to say there might not be some connection among check boxes in a group. For example, it is not out of the question to script the checkbox that clicking it will automatically checks other related checkboxes. Because a check box widget is a simple type of the button, its methods are very similar to the button widget.

XML Element Name

<Checkbox/>

Example

Checkbox widgets are placed in the widget that behaves like a container. We have specified the check box's shape and the label. The check box's border, fonts, colors, and highlight take default settings.
<Widget setSize="200,100">
<Checkbox setShape="5,5,100,30" setLabel="Checkbox 1"/>
<Checkbox setShape="5,40,100,30" setLabel="Checkbox 2"/>
</Widget>


Checkbox 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.

The specific to the Checkbox is setValue method

Back    Next