in reply to Tk (Tcl::Tk) programmatically monitor change in Listbox
You will need to subclass Tk::Listbox and override the relevant methods.
Trapping programmatic changes to the UI is probably a bad idea, however, and you should arrange for a notification to be processed by some other means. Tk works very well as the "V" in "MVC", so you will probably get much cleaner code if you have a method in another object that represents whatever the listbox choices are. Preserve that separation and your code will be easier to maintain. Right now, your code seems to be headed towards "tissue of hacks" and Big Ball of Mud.
Sadly, Tk does not appear to have a mechanism for passing generic program-generated events to callbacks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tk programmatically monitor change in Listbox
by Anonymous Monk on Jan 06, 2020 at 10:23 UTC | |
by jcb (Parson) on Jan 07, 2020 at 02:11 UTC | |
by huck (Prior) on Jan 07, 2020 at 15:37 UTC | |
by Anonymous Monk on Jan 07, 2020 at 04:46 UTC | |
by Anonymous Monk on Jan 06, 2020 at 15:56 UTC |