Version 1 of gnocl::ruler

Updated 2009-05-22 08:28:00 by WJG

WJG (22/05/09) The Gtk Widget is a legacy of the GIMP image processing package and so, as expected, there are a few legacy widgets which need to be implement in Gnocl, to claim the status of complete support. One of these is the creation of horizonatl and veritical rulers to be used in conjuction with drawing objects for edition purpose. Here's a sample screenshot and the test script.

http://wjgiddings.googlepages.com/Screenshot-rulerTest.tcl.png

#---------------
# Author:   William J Giddings
# Date:     07/05/09
#---------------
#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"
#---------------

package require Gnocl
package require GnoclCanvas

# build UI components
set bar [gnocl::statusBar]

set Vrul [gnocl::ruler -orientation vertical -metric inches]
set Hrul [gnocl::ruler -orientation horizontal -metric pixels]
set can [gnocl::canvas -background white -onMotion {$bar push "%x %y"} ]

set tab [gnocl::table -homogeneous 0]
$tab addRow [list "" $Hrul] -expand {1 0}
$tab addRow [list $Vrul ] -expand { 0 1}
$tab add $can 1 1

set box [gnocl::box -orientation vertical]
$box add $tab -fill {1 1} -expand 1
$box add $bar

gnocl::window -child $box -widthRequest 320 -heightRequest 200

enter categories here