Hi,
I am working my way through some tk examples (http://www.bin-co.com/tcl/tutorial/widgets4.php) and converting them to ltk. I figured that would be a nice way to learn ltk.
I am now stuck with listbox. Here are the specific questions:
- How do I initialize the list (populate it with items)? - How do I get the index of the current selection? I am assuming it may be an argument to the event function, but without initializing the list, I could not test that hypothesis - How do I get the list item at the particular index.
As I noted before, I would be happy to post the resulting code in form of a (newbie) ltk tutorial.
Thank you,
Mirko
Hi,
to add items use the listbox-append function, e.g.
(listbox-append mybox (list "a" "b" "c"))
to find out about the selected element(s), use listbox-get-selection, which returns a list of the selected indexes.
HTH, Peter
On Nov 26, 2007 4:16 AM, Peter Herth herth@peter-herth.de wrote:
Hi,
to add items use the listbox-append function, e.g.
(listbox-append mybox (list "a" "b" "c"))
to find out about the selected element(s), use listbox-get-selection, which returns a list of the selected indexes.
HTH, Peter
Thank you Peter.
Mirko