Sunday, February 10, 2013


The currently nightly build has code for some useful megawidgets which yet need fully documenting. One of these is the gnocl::labelEntry. Apart from having a label and entry the re is also the possibility of adding a child widget. This type of object can certainly be made in gnocl from simpler components, but this higher level of abstraction just makes life that much easier!

Here's a screen shot and sample script.

# test-le.tcl
#!/bin/sh \
exec tclsh "$0" "$@"

package require Gnocl

set app(find,regexp) 1

set cb(1) [gnocl::checkButton \
    -text "regexp" \
    -variable app(find,regexp)]

set le(1) [gnocl::labelEntry \
    -text "Search For:" \
    -variable app(find) \
    -primaryIcon "%#Paste" \
    -secondaryIcon "%#Clear" \
    -onIconPress {puts "Yo!"}]
$le(1) configure \
    -child $cb(1)       

gnocl::window \
    -child $le(1) \
    -title "gnocl::labelEntry"

No comments: