#! ../wafe --f
# This is a demo script for (mostly) shaped pixmaps in labels and icons. 
# The warning message for "Very Large" under "Not Resizable" is intended.
#
# Gustaf Neumann                        Mohegan Lake, July 3, 1994

if {[lsearch $PACKAGES XPM] == -1} {
  puts stderr "\n\
    This script can only be used, when wafe was compiled with XPM support\n\
    Your version of wafe is configured for the following packages:\n\
    \t $PACKAGES\n"
   quit
}

set title(f1) "Not Resizable:"
set title(f2) "Resizable:"

set label(alkier.xpm)  "Unshaped"
set label(mfull.xpm)   "Shaped"
set label(ws10.xpm)    "Larger"
set label(ws11.xpm)    "Very Large"
set label(None)        "None"

sV topLevel allowShellResize true

mergeResources topLevel \
    *f1.Label*resizable false  \
    *f2.Label*resizable true   \
    *Label.borderWidth  0      \
    *l*background       pink   \
    *background         #d0d0d0

proc setIcon {pix} {
  changePixmap topLevel iconPixmap $pix
}

Box b topLevel
foreach f {f1 f2} {
  set F [Form $f b]
  Label t $F label $title($f)
  Label l $F width 110 height 110 fromVert $F.t
  Box x $F orientation HORIZONTAL fromVert $f.l borderWidth 0
  foreach pix {alkier.xpm mfull.xpm ws10.xpm ws11.xpm None} {
    Command c $F.x label $label($pix) callback "changePixmap $F.l bitmap $pix"
  }
}
Box last b orientation HORIZONTAL
Command quit last callback quit
Command iconFull last callback  {setIcon mfull.xpm}
Command iconEmpty last callback {setIcon mempty.xpm}
setIcon mempty.xpm
realize

#DBUG_PUSH d:t