#!/bin/sh
# ----------------------------------------------------------------------
#  DEMO: shell in [incr Widgets] -tops option
# ----------------------------------------------------------------------
#\
exec itkwish "$0" ${1+"$@"}
package require Iwidgets 3.0
source load.tcl

#
# Demo script for shell class -tops option
#

iwidgets::shell .a1 -title A1 -master .    -tops .
iwidgets::shell .a2 -title A2 -master .
iwidgets::shell .b1 -title B1 -master .a1  -tops .a1
iwidgets::shell .b2 -title B2 -master .a2

wm title    .  "MASTER"
wm geometry .  600x400+0+0
wm geometry .a1 200x200+50+100
wm geometry .a2 200x200+350+100
wm geometry .b1 100x150+100+200
wm geometry .b2 100x150+400+200

.a1 activate
.a2 activate
.b1 activate
.b2 activate

label .l -anchor n -text \
"Please, try to raise and lower each of the windows and watch whats happening.\n\
The result depends also on your window manager.\n\
There are 5 toplevel windows in total:
B1 ontop of A1 ontop of MASTER\n\
B2 ontop of A2 ontop of MASTER"
pack .l -expand true -fill both

label [.a1 childsite].l -anchor n -text "-tops \"MASTER\""
label [.a2 childsite].l -anchor n -text "-master \"MASTER\""
label [.b1 childsite].l -anchor n -text "-tops \"A1\""
label [.b2 childsite].l -anchor n -text "-master \"A2\""
pack [.a1 childsite].l [.a2 childsite].l [.b1 childsite].l [.b2 childsite].l \
    -expand true -fill both
