|
From: jschmeiser on 26 Jun 2008 22:10 Hello, I've been looking for the answer to this for an embarrasingly long time... A combobox in a GUI displays values from a list. That list is updated by user actions but I can't get the combobox to update to show the new values that have been appended or changed in the list. Optimally, the combobox selections should change everytime there is a change to the list. All I need is to know a general command that does this or an idea that I can chase down on google. I've already constructed a combobox that displays the first value of the list (list starts with one entry until users add to it...). Deep down I know that the answer is simple but I haven't been able to find this in the man pages. Thanks for any help, Savage
From: Óscar Fuentes on 26 Jun 2008 22:39 jschmeiser(a)msn.com writes: > A combobox in a GUI displays values from a list. That list is updated > by user actions but I can't get the combobox to update to show the new > values that have been appended or changed in the list. Optimally, the > combobox selections should change everytime there is a change to the > list. Which combobox? (Tile, BWidget, ...) I would put a trace on the variable that holds the list, and there update the combobox by assigning the -values option. [snip] -- Oscar
From: rf on 27 Jun 2008 07:34 On Jun 27, 4:10 am, jschmei...(a)msn.com wrote: > Hello, > > I've been looking for the answer to this for an embarrasingly long > time... > > A combobox in a GUI displays values from a list. That list is updated > by user actions but I can't get the combobox to update to show the new > values that have been appended or changed in the list. Optimally, the > combobox selections should change everytime there is a change to the > list. > > All I need is to know a general command that does this or an idea that > I can chase down on google. I've already constructed a combobox that > displays the first value of the list (list starts with one entry until > users add to it...). > > Deep down I know that the answer is simple but I haven't been able to > find this in the man pages. > > Thanks for any help, > > Savage a BWidget ComboBox in a complete application named iFile 1.1 from http://wiki.tcl.tk/8540 together with a small extension http://wiki.tcl.tk/14583 shows dynamic list updates. Perhaps the event handling may serve as an example for your purpose, especially to get the listbox visible. roland frank
From: Gerry Snyder on 27 Jun 2008 12:50 �scar Fuentes wrote: > jschmeiser(a)msn.com writes: > >> A combobox in a GUI displays values from a list. That list is updated >> by user actions but I can't get the combobox to update to show the new >> values that have been appended or changed in the list. Optimally, the >> combobox selections should change everytime there is a change to the >> list. > > Which combobox? (Tile, BWidget, ...) > > I would put a trace on the variable that holds the list, and there > update the combobox by assigning the -values option. Just to expand a little: the combobox (at least Tile/ttk) takes a (copy of a) list, not a variable name. The widget has no way of knowing that the original list changed, since its copy does not change. Depending on how you change the original master list, either use the trace recommended above, or just do the configure whenever you change the list. The latter would probably be easier if the list is changed in just one place. Gerry
From: jschmeiser on 29 Jun 2008 02:09 Thank you all. Simply put it sounds like trace or configure are my best bet. I had read up on these but obviously got lost in the man pages... Now I know what to concentrate on though. Thanks again.
|
Next
|
Last
Pages: 1 2 Prev: How to make TCL to show the error stack in interpreted mode? Next: Devanagari question |