Monday, November 01, 2010

gnocl::iconView - adding items with labels

I've now created the structure to add options to the iconview add
command. This will be useful if some other info apart from a filepath is
needed. Also, in progress is the use of percentage markup strings. This
will enable the choice between file, stockitem and pixbuf sources. If
the specified icon is unavailable then a default item will be displayed.
Here's a sample of the test code...


set iv [gnocl::iconView \
    -columns 1 \

    -orientation vertical \

    -itemWidth 100 ]

gnocl::window \

    -title VERTICAL \

    -child $iv \

    -width 150 \

    -height 300 \

    -onDestroy {exit}


for {set i 1}  { $i <= 3} { incr i } {

  $iv add "%?im-0001.pnm" -label "item $i"
}
$iv add pointer.png -label pointer

$iv add upArrow.png -label up

$iv add downArrow.png -label down


And the result...








No comments: