callback
The command procedure to be executed when window is scrolled by a user operation on the window’s scrollbars. It is invoked in three cases:
When the mouse button is released at the end of a scroll operation, known as "new-position".
When the top (or left) arrow button is pressed while the CONTROL key is depressed, known as "get-previous".
When the bottom (or right) arrow button is pressed while the CONTROL key is depressed, known as "get-next".
The "get-previous" operation also scrolls to the top (or left) of the window. "get-next" also scrolls to the bottom (or right).
When a scroll procedure is defined for a window and is invoked, three parameters are passed to the procedure:
1. The window identifier.
2. Which scrollbar was used (a numeric value);
0 Indicates horizontal.
1 Indicates vertical.
3. Which user action invoked the procedure (a numeric value);
0 New-position.
-1 Get-previous.
1 Get-next.
The procedure is executed after the scroll operation and thus after any necessary window repaint. A window without scrollbars never invokes this procedure.
New windows have a scroll procedure of null.
window.scroll (<window>,<num>,<num>)
window mywin = wgraphic -wk=<2,2> mywin.scroll = { args w=window, v=numeric, mode=numeric tell <'Scroll operation:',w> if (v) !Vertical scrollbar else !Horizontal scrollbar switch mode { case -1: !Get previous case 1: !Get next default: !New position } }
Commands: |