[ltk-user] listbox api

Nikita B. Zuev nikitazu at gmail.com
Thu Nov 1 15:46:39 UTC 2012


Hello,

I'm having a little trouble with usage of a listbox in LTK library,
and would appreciate some assistance.

Documentation states that there is a LISTBOX class
http://www.peter-herth.de/ltk/ltkdoc/node25.html
but nothing about how to manipulate its contents.

Google have helped me to find LISTBOX-APPEND to add items and
LISTBOX-GET-SELECTION to
retrieve selection. Thing here is LISTBOX-GET-SELECTION returns list
of indices, not actual items,
and nothing in google says about where to apply index to get actual
selected item.
That is easy to workaround by using a separate variable to store list
of items and pushing to it
after adding item to LISTBOX instance, then getting selection from
LISTBOX and getting selected
item from this variable by index, but I have a feeling that I'm doing
it wrong, and overcomplicating
things.

Also docs say
http://www.peter-herth.de/ltk/ltkdoc/node15.html
:COMMAND initarg can be used to handle LISTBOX's selection change event, but
(MAKE-INSTANCE 'LISTBOX :command (lambda () ... )) fails saying it has
no such initarg,
well BIND works, so its ok probably.

Main question is, can someone please provide me with a little example
of LISTBOX's proper usage?

LTK library is from the quicklisp repository.

Thanks.

-- 
Regards,
Nikita B. Zuev




More information about the ltk-user mailing list