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

load ../src/gnocl.so

set mainBox [gnocl::box -orientation vertical -label "With box"]

$mainBox add [gnocl::label -text \
      "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"]
$mainBox add [gnocl::label -text "Left"] -align 0
$mainBox add [gnocl::label -text "Left 20%"] -align 0.2
$mainBox add [gnocl::label -text "Center (Default)"] 
$mainBox add [gnocl::label -text "Right 80%"] -align 0.8
$mainBox add [gnocl::label -text "Right"] -align 1 

set table [gnocl::table -homogeneous 1 -label "With table"]
$mainBox add $table
$table add [gnocl::label -text \
      "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"] 0 0
$table add [gnocl::label -text "Left"] 0 1 -align 0
$table add [gnocl::label -text "Left 20%"] 0 2 -align 0.2
$table add [gnocl::label -text "Center (Default)"]  0 3
$table add [gnocl::label -text "Right 80%"] 0 4 -align 0.8
$table add [gnocl::label -text "Right"] 0 5 -align 1 

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

gnocl::mainLoop

