|
Contents | Previous | Next | Subchapters |
| See Also | addlabel |
addcontrol(caption, geometry, "textfield")
addcontrol(caption, geometry, "textfield", text)
addcontrol(caption, geometry, "textfield", text, call back)
Adds a "textfield" control,
with the specified
geometry
,
to the Dialog window specified by
caption
.
The character row vector text specifies the initial text to be
placed in the field.
The command specified by
call back
is executed whenever the contents of the text field is changed
by the user.
The return value is the
control handle
for the text field.
getcontrol(handle)
Returns the text displayed in the "textfield" control specified by
handle, where
handle is the value returned by addcontrol
when the "textfield" control was created.
The return value is a character row vector.
setcontrol(handle, text)
Changes the text displayed in the "textfield" control specified by
handle to the value specified text, where
handle is value returned by addcontrol
when the "textfield" control was created and text is
a character row vector.
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, 160, 20]
text = "initial value"
Handle = addcontrol(Caption, geometry, "textfield", text);
#
geometry = [70, 50, 50, 20]
name = "Done"
callback = "Done"
addcontrol(Caption, geometry, "pushbutton", name, callback);
#
count = 0
function Done() begin
global Handle, count, Caption
count = count + 1
if count == 1 then begin
setcontrol(Handle, "modify this");
return
end
print getcontrol(Handle)
delwin(Caption);
end