| Allegro CL version 10.0 Unrevised from 9.0 to 10.0. 9.0 version |
Arguments: standard-object
Returns the value of the value property of the argument. The value
property holds the value of a control or component. The format of the
value depends on the type of component (it might be a number, a
string, a boolean (t or nil
), etc.) Often the
value is changed by user action, usually in a dialog displayed
precisely to get user input.
(setf value) may be called to change the value of a control programmatically. The appearance of the control will update to reflect the new value, just as if the user had specified the new value interactively. If the control has an on-change event handler function, and the on-change-test function of the control determines that the new value is considered to be different from the previous value, then the on-change function is called. (To change the value without invoking the on-change function, call initialize-value instead.)
For controls with a range (such as a trackbar
or a combo-box
), it is an error to
specify a value, either initially with the :value init argument or
with setf of value, outside the range.
See also fetch-control-value, which forces the operating system to update the value of a control. There are cases (discussed in the description of that generic function) where the value returned by value might be out of date.
If you call (setf value) and notice that the widget is not
redrawn to display the new value as expected, the problem may be that
the widget's on-change-test
function regarded the new value as being equivalent to the old one,
and therefore that no updating was needed. This problem can be
remedied by changing the on-change-test to a function that properly
returns nil
for any two values that should be
considered distinct. In particular, if you destructively modify the
object that is the current value of a widget, and then set the value
of the widget to be that same modified object, then the default
on-change-test function
(widget-value-equal) will
return true because the new and old values are eq, and the widget's appearance will
not be updated. Specifying nil
as the
on-change-test will avoid the
problem in special cases such as this, by causing the new and old
values never to be regarded as equivalent.
(setf value) takes an additional optional argument called recursive-p. This argument will be true if (setf value) is being called due to the user modifying a widget interactively, such as by typing into a text widget. An application should not pass this value as true, but it might be informative in a wrapper method.
Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 9.0 page.
Created 2015.5.21.
| Allegro CL version 10.0 Unrevised from 9.0 to 10.0. 9.0 version |