Wednesday, October 06, 2010


Gtk has support for stock items as well as loading graphics into containers. What has been needed for sometime is the creation of application specific stock items. This is now possible with the new gnocl::stockItem command. Although there's a lot of fiddly work done 'under the bonnet', the Tcl binding is quite simple:

gnocl::stockItem add -label News -icon [pwd]/news.png

The stock item can then be repeatedly accessed, all resizing etc out large graphics is all taken care of! For example:

set but4 [gnocl::button -icon "%#News" -text News]

The next step is to allow the creation of stockitems from pixbufs. This might be useful to someone for creating widget buttons that need refreshing.

No comments: