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

# this example shows all stock bitmaps for buttons and menuitems
load ../src/gnocl.so

gnocl::dialog "A Try?" [list %#Yes %#No %#Help] -default 0 \
      -type question -text "If you like the easy way of creating a GUI with tk,\nbut find the look and feel of gtk/gnome nicer and\ndo not already know gnocl, you realy should try it.\nDo you want to give gnocl a try?"

set erg [gnocl::dialog "Test dialog" [list %#Cancel Cancel %_Cancel]]
puts $erg

foreach el {none info warning error question} {
   set erg [gnocl::dialog "$el dialog" [list %#Cancel %#Ok %#Help] \
         -type $el -modal 1 -text "$el text"]
   puts $erg
}

set buttons ""
foreach el { "Ok" "Cancel" "Yes" "No" "Close" "Apply" } {
   lappend buttons "%#$el"
}
set erg [gnocl::dialog "Test dialog" $buttons -default 0]
puts $erg

set buttons ""
foreach el { "Next" "Prev" "Up" "Down" "Help" "Font" } {
   lappend buttons "%#$el"
}
set erg [gnocl::dialog "Test dialog" $buttons -default 1]
puts $erg

if { [info exists tk_patchLevel] } {
   wm withdraw .
} else {
   gnocl::mainLoop
}
