Friday, January 28, 2011

gnocl::iconView - more work

The past few days has seen little posted to the blog but that doesn't mean that the Gnocl wheel has not been turning! Earlier this week I posted an article to tutorials page at to show how easy it is to set up and C-coded packages for Tcl. There are some useful materials in the Tcler's wiki but I wanted something much more. Most of the inconvenience is continuously creating the basic skeleton and makefiles etc. I created some boiler plates for new packages and all of the naming, versioning and so on are managed through the Makefile.

Today I turned my attention back to the gnocl::iconView widget. This object will now happily accept new images and add them to the display.

Here's the test script.

# Author:   William J Giddings
# Date:     28/01/11
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

package require Gnocl

#-icons [list wjg.png gnocl.png wjg.png gnocl.png wjg.png gnocl.png] \

if { 0 } {
set iv [gnocl::iconView \
    -columnSpacing 20 \
    -margin 5 \
    -spacing 15 \
    -columns 4 \
    -rowSpacing 20 \
    -pixbufColumn 0 \
    -textColumn 1 \

set iv [gnocl::iconView]

$iv add "%/./georgie.png" -label Georgie
$iv add "%/./wjg.png" -label WiGi
$iv add "%/./gnocl.png" -label NEW
$iv add "%/./wjg.png" -label WiGi

gnocl::window \
    -child $iv \
    -title gnocl::iconView \
    -widthRequest 200 \
    -heightRequest 200


Can't really say that I've found these two tasks fulfilling. It meant going over some old code the errors within which I had long  since forgotten and had to resolve these before being able to move forward.

No comments: