Generic FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version

unpress-automatically

Arguments: picture-button-or-multi-picture-button

Returns whether a picture-button will automatically unpress itself just after the user has pressed it interactively, or whether a multi-picture-button will automatically unpress any of its buttons just after that button is pressed interactively. The default value is nil, which means that a pressed button will stay pressed until the user unpresses it explicitly (or presses another button within a multi-picture-button when its multiple-selections property is nil). The setf of this function may be called to set the value of this property, or it may be specified when creating the widget by passing the unpress-automatically initarg to make-instance.

If the value of this property is true, then when the user presses a button interactively, the button will be unpressed automatically just after the widget's on-change function (if any) has run. The unpressing of the button is therefore a visual indication of when the button has completed its action. The button is unpressed internally by calling initialize-value, and so the on-change function will not be called again as a result of the unpressing.

This property affects only interactive button-pressing, and does not affect pressing buttons programmatically by calling (setf value). A button may be pressed interactively either by clicking it or by pressing the spacebar when the button has the keyboard focus (for a multi-picture-button, the latter requires the draw-focus property to be true).

Setting this property to true is essentially equivalent to returning (not new-value) from the on-change function, which would return nil to reject the new value when a button is pressed down, but return true when all buttons are unpressed. We had suggested that return value in earlier releases, but that technique was rather obscure.

For a multi-picture-button, setting this property to true when the multiple-selections property is also true is probably not useful, since there would be no way for the user to press multiple buttons down interactively (though that would still be possible by calling (setf value).)

Example

;;  In the following example, my-multi-picture-button 
;;  is assumed to be the widget object (rather than, 
;;  say, the widget name). To test this, you could 
;;  use the Tools | Get Component command, then click on a 
;;  multi-picture-button to return it, and then evaluate:
;;    (setf my-multi-picture-button *)

(setf (unpress-automatically my-multi-picture-button) t)

Copyright (c) 1998-2012, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 8.2. This page was not revised from the 8.1 page.
Created 2010.1.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version