Assigns an action to evaluate when the user selects the specified tile in a dialog box
(action_tile key action-expression)
The action assigned by action_tile supersedes the dialog box's default action (assigned by new_dialog) or the tile's action attribute, if these are specified. The expression can refer to the tile's current value as $value, its name as $key, its application-specific data (as set by client_data_tile ) as $data, its callback reason as $reason, and its image coordinates (if the tile is an image button) as $x and $y.
Arguments
key
A string that names the tile that triggers the action (specified as its key attribute). This argument is case-sensitive.
action-expression
A string naming the expression evaluated when the tile is selected.
Return Values
Returns T
The $reason variable will be one of:
1 | This is the value for most action tiles. The user has selected the tile (possibly by pressing Enter, if the tile is the default and the platform recognizes accelerator keys).
|
2 | Edit boxes: The user has exited the edit box, but has not made a final selection. |
3 | Sliders: The user has changed the value of the slider by dragging the indicator but has not made a final selection. |
4 | List boxes and image buttons: This callback reason always follows a code 1. It usually means “commit to the previous selection.” It should never undo the previous selection; this confuses and annoys the user.
|
For text boxes, the action-expression is evaluated when the focus leaves the text box.
Sample:(action_tile "accept" "(do_exit)")
The quotes around the key and action-expression are essential.
(action_tile "myeditbox" "(edit_action $value $reason)")
This sample shows the use of the special variables.