Tuesday, September 02, 2008

Lists meet autoglade

The latest autoglade (available from svn repository) now supports lists as a special case of a GtkTreeView widget usng a ListStore model with a single column. Remember, as always, it's a zero programming solution.

As other widgets, lists can be initialized from the environment using autoglade annotation to its name, for example:

treeview1:auto:init:env

will use the environment variable treeview1 to obtain list header and items

export treeview1='("Fruits" "Apples" "Bananas" "Hedge aple" "Kiwifruits" "Melons" "Oranges" "Pineapples" "Strawberries" )'

Using one of the tests also present in the svn repository

$ ./list.sh


and, after selecting one item and pressing OK

treeview1='("Kiwifruits")'
autoargs='$treeview1'

appears in application's stdout.

More information about autoglade can be obtained from http://autoglade.sf.net.
Post a Comment