![]() |
|
P is for Practical | |
PerlMonks |
Tk (Tcl::Tk) programmatically monitor change in Listboxby IB2017 (Pilgrim) |
on Jan 05, 2020 at 09:53 UTC ( #11110970=perlquestion: print w/replies, xml ) | Need Help?? |
IB2017 has asked for the wisdom of the Perl Monks concerning the following question: Hello Monks I need to monitor if a new element has been programmatically added to a Listbox. If a new element has been added, a subroutine should be called. Since I am not aware of any callback for this, in the script below, I try to use programmatically select a Listbox element with selectionSet (whenever a new element is added) in order to let the <<ListboxSelect>> call a subroutine. The approach does not work, since <<ListboxSelect>> seems to be called only if a Listbox element is selected by the user. Using <<Modified>> does not work too. Any suggestion on how I could solve this?
EDIT The code above is in Perl/Tk and not in Tcl::Tk simply because I was looking for a solution independently of Tcl::Tk, as I thought a callback triggered by a state change in the Listbox was easier/possible to achieve then working on the Tcl bridge to Perl through Tcl::Tk (or the similar Tcl::pTk)
Back to
Seekers of Perl Wisdom
|
|