LTK: listbox
Posted: Fri Jul 05, 2013 3:36 pm
LTK users here?
I've come across certain issues concerning the listbox widget.
First of all, evidently there's no `activate' method.
Suppose I create a listbox with three items and select the second (i. e. the middle) one at the initialization:
Naturally when the user presses arrow keys, it's desirable that the selected item should be active. However, it's the last one that is active in the example above. As a way out one could use the activate method, but it hasn't apparently been implemented. Actually the implementation isn't hard at all:
However, I'm afraid I may be missing some point...
On a related note: the listbox widget has the listvariable option. However, I failed to produce a working example. Any suggestions? (BTW, I greatly appreciate LTK's design in the way that it keeps all the StringVar mess under the hood, unlike Python. It would be nice to have the VALUE method for listboxes as well. Yet I don't know how to retrieve listbox items if not implementing listbox-get, which is also missing and perhaps obsolete.)
I've found the LTK mailing list, but something must be wrong with mailing lists on common-lisp.net, the links are broken for the most part.
I've come across certain issues concerning the listbox widget.
First of all, evidently there's no `activate' method.
Suppose I create a listbox with three items and select the second (i. e. the middle) one at the initialization:
Code: Select all
(with-ltk ()
(let ((l (make-instance 'listbox)))
(listbox-append l '("foo" "bar" "baz"))
(listbox-select l 1)
(pack l)
(focus l)))
Code: Select all
(defgeneric listbox-activate (l index))
(defmethod listbox-activate ((l listbox) index)
(format-wish "~a activate ~a" (widget-path l) index)
l)
On a related note: the listbox widget has the listvariable option. However, I failed to produce a working example. Any suggestions? (BTW, I greatly appreciate LTK's design in the way that it keeps all the StringVar mess under the hood, unlike Python. It would be nice to have the VALUE method for listboxes as well. Yet I don't know how to retrieve listbox items if not implementing listbox-get, which is also missing and perhaps obsolete.)
I've found the LTK mailing list, but something must be wrong with mailing lists on common-lisp.net, the links are broken for the most part.