Element: window.scroll { }

Type

callback

Description

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:

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:

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.

Parameters

window.scroll (<window>,<num>,<num>)

Examples

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
    }
}

See Also

Commands:

wscroll