
2.3 The viewport hierarchy
move-viewport so that they are visible in their new parent's screen clipping region.
(setq *parent2*
(make-window :width 100 :height 100
:x 110 :title "parent2"))
(setq *child2*
(make-window
:width 60 :height 50 :x 110 :y 50
:title "child2"
:parent *parent2*))
(deactivate-viewport *parent1*)
(deactivate-viewport *parent2*)
(setf (viewport-parent *child1*) *parent2*)
(setf (viewport-parent *child2*) *parent1*)
(move-viewport *child2* 0 50)
(move-viewport *child1* 110 50)
(activate-viewport *parent1*)
(activate-viewport *child2*)
(activate-viewport *parent2*)
(activate-viewport *child1*)
In the following example,*parent1* takes*child1* back again; it now has two children:(deactivate-viewport *parent1*) (deactivate-viewport *parent2*) (setf (viewport-children *parent1*) (list *child1* *child2*)) (move-viewport *child1* 40 30) (activate-viewport *parent1*) (activate-viewport *parent2*) (activate-viewport *child1*) (activate-viewport *child2*)Notice that
*child1* is overlapping*child2* because*child1* is first child on the list given to viewport-children. The viewport*parent1* now has two children, and*parent2* has none. If you want*child2* to overlap*child1*, expose*child2* or hide*child1*. The sibling stack reflects the change in order between siblings.

Generated with Harlequin WebMaker