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

if { $argc != 1 } {
   puts "usage: $argv0 socket-XID"
}

load ../src/gnocl.so

set mainBox [gnocl::box -orientation vertical -homogeneous 0]
set toolbar [gnocl::toolbar]
$toolbar add item -text "Quit" -icon "%#Quit" -command "puts quit"
$toolbar add space
$toolbar add item -text "Png" -icon "%/./nodiaminus.png" \
      -command {$item configure -sensitive 0}
$toolbar add item -text "Gif" -icon "%/./nodiaminus.gif" \
      -command {$item configure -sensitive 0}
set item [$toolbar add item -text "Gif" \
      -icon "%/./nodiaminus.gif" -command "puts gif"]


$mainBox add $toolbar
$mainBox add [gnocl::pixmap "%/./nodiaminus.png"]
$mainBox add [gnocl::pixmap "%/./nodiaminus.png" -width 100 -height 100]
$mainBox add [gnocl::pixmap "%/./nodiaminus.png" -width 100 -height 50]
if { $argc == 1 } {
   set win [gnocl::plug [lindex $argv 0] -child $mainBox]
} else {
   set win [gnocl::window -child $mainBox -width 200 -height 200]
}

gnocl::mainLoop

