|
Contents | Previous | Next | Subchapters |
| See Also | radiobuttons |
addcontrol(caption, geometry, "checkbox", name)
addcontrol(caption, geometry, "checkbox", name, call back)
Adds a "checkbox" control,
with the specified
geometry
,
to the Dialog window specified by
caption
.
The character row vector name specifies the label that
is placed to the right of the check box.
The command specified by
call back
is executed whenever the state of the check box is changed
by the user.
The return value is the
control handle
for the check box.
getcontrol(handle)
Returns the current state of the "checkbox" control specified by
handle, where
handle is the value returned by addcontrol
when the "checkbox" control was created.
The return value is a logical scalar.
setcontrol(handle, flag)
Changes the current state of the "checkbox" control specified by
handle to the value specified flag, where
handle is value returned by addcontrol
when the "checkbox" control was created and flag is
a logical scalar.
The return value of setcontrol is true, if the
control can be set as requested, and false otherwise.
clear
#
Caption = "Test Dialog"
geometry = [100, 100, 200, 100]
callback = "delwin(Caption);"
adddialog(Caption, geometry, callback);
#
geometry = [20, 20, 150, 20]
text = "Check Box"
StateLbl = "State ="
callback = "print StateLbl, getcontrol(Handle)"
Handle = addcontrol(Caption, geometry, "checkbox", text, callback);
setcontrol(Handle, true);
#
geometry = [70, 50, 50, 20]
name = "Done"
callback = "delwin(Caption);"
addcontrol(Caption, geometry, "pushbutton", name, callback);
#