|Liberty BASIC Help Online
This command sets up an event handler for the instance when the user resizes a window of type "window". This command is not useful for dialog windows, graphics windows, text windows, or for windows without a sizing frame. The resize event can be handled in a named branch, or in a subroutine. If a sub is used as the event handler, the handle of the window being resized is passed into the sub.
'set up a handler for when the user resizes a window
print #handle, "resizehandler [branch]"
'clear the resizing handler
print #handle, "resizehandler"
The [branch] that is activated for the resize event should contain the code to LOCATE the desired controls. After all controls have been given a LOCATE command, the window must be given a REFRESH command to cause it to be repainted.
After the resizehandler has been activated, the new dimensions of the window workspace are contained in the variables WindowWidth and WindowHeight. Use these dimensions to calculate the desired size and placement for the controls in the window. See also: LOCATE , REFRESH Window and Dialog Commands
See the example program RESIZE.BAS and the demo below:
'resizehandler using a sub
button #main.close, "Close", quit, UL, 10, 10
open "example" for window as #main
#main "resizehandler resized"
#main "trapclose quit"
sub resized handle$
sub quit handle$
if instr(handle$, ".") then
handle$ = left$(handle$, instr(handle$, ".")-1)
Copyright (C) 2003 Shoptalk Systems
Liberty BASIC - http://www.libertybasic.com/