2 Bitmaps, Viewports, and Windows

2.4 Moving and reshaping viewports and windows

You can relocate viewports and windows to any position and resize them to any width and height. There is no restriction on the location of a viewport or window with respect to the root viewport. If the viewport or window is outside of the root viewport's screen boundaries, you cannot see the viewport or window on the screen, but it is still there. You can always reposition a viewport or window to be within screen boundaries.

The root viewport cannot be moved or reshaped from within the Window Tool Kit, though some host window systems allow this action.

Create a window, and move it to a new location:

(setq *window2* (make-window :width 60 
                             :height 40 
                             :title "Move Me"))
(move-viewport *window2* 100 100)

If you move a viewport or window with children, the children move with the parent by default; they remain in the same position relative to the parent.

Now, reshape*window2*:

(reshape-viewport *window2* :width 120 :height 80)

The Window Tool Kit - 9 SEP 1996

Generated with Harlequin WebMaker