#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

load ../src/gnocl.so

set mainBox [gnocl::box -orientation horizontal]

set bh [gnocl::box -orientation vertical]
set bv [gnocl::box -orientation horizontal]

$mainBox add [list $bh $bv]

foreach layout {default spread edge start end} {
   foreach box [list $bh $bv] or {horizontal vertical} {
      set bb [gnocl::box -orientation $or -layout $layout -label $layout \
            -buttonType 1]
      $bb add [gnocl::button -text "%#Ok"]
      $bb add [gnocl::button -text "%#Cancel"]
      $box add $bb
   }
}

if { $argc == 1 } {
   set win [gnocl::plug [lindex $argv 0] -child $mainBox]
} else {
   set win [gnocl::window -child $mainBox]
}

gnocl::mainLoop

