I'm using tk widget Combobox and whenever I select any item in it it gives
invalid command name .top47.not48.fpage2.sw.sf.frame.cf2.frame.c.shell.listb
my code looks like this:-
ComboBox $mainframe.cf2.frame.c -textvariable variable1 \
-values Corners -modifycmd "new_values"
This is the main combobox that controls all the values of other combobox'es present in it which don't give any error like this.
This is very likely due to an error in the "new_values" function you have omitted. As a sample to show this:
Now when you run this and select an entry from the dropdown you get 'Error: invalid command name ".xyzzy"'. The window you are trying to address is evidently digging into the internal implementation of this BWidgets class as
winfo children .c
shows me that .c.shell.listb exists. However, this is unsafe - the implementation may change from one version to the next and you don't control when the dropdown is created and destroyed. Check for the existence of your target window usingwinfo exists $combo.shell.listb
as a minimum. You may want to ensure a compatible version of the BWidgets package too by usingpackage require -exact BWidget 1.M.N