3

My company is using Python 2.6 (yuck, I know, but it's my constraint). I need to make a little GUI that involves a ComboBox. I chose Tix, because that's what I have--not allowed to grab anything else.

Anyway, I'd like to set the label that the ComboBox has to the top side. According to the documentation at http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixComboBox.htm, if I use "labelside" in the ComboBox constructor as a parameter, it should move the label to the top, like I want.

Unfortunately, when I do this, it gives me a strange error:

_tkinter.TclError: cannot assigned to static variable "-labelside"

CONTEXT: this is within a Python class that inherits from Tix.Frame. The first code example works perfectly, the other does not.

My constructor (not including 'labelside') looks like this:

combobox = Tix.ComboBox(self,
                        label="Available files: ",
                        selectmode='immediate',
                        dropdown=0,
                        editable=0,
                        variable=selectedfile,
                        options='listbox.height 5')

It works perfectly, as expected. I get a nice ComboBox in my window. The label is the left side, however--not what I want.

So, I try this:

combobox = Tix.ComboBox(self,
                        label="Available files: ",
                        labelside='top',
                        selectmode='immediate',
                        dropdown=0,
                        editable=0,
                        variable=selectedfile,
                        options='listbox.height 5')

That's when it gives me the error. I've scrounged the internet for answers, but have found only users who have the same unanswered question: why is it happening? It would appear that I'm following the documentation correctly.

I also tried substituting Tix.TOP for top, and it gave me the same error.

Any help or ideas would be greatly appreciated!

  • As far as I have understood Tix is no more developed and maintained unfortunately, so it is possible that there are plenty of bugs... Check out the source code for ComboBox, and maybe you get an answer faster... – nbro Sep 17 '15 at 19:52
  • I looked at the source code, too (Tix.py), and I can't figure out much. I ended up just grabbing the label object itself from the ComboBox and packing it manually (side = TOP). So much for that parameter... – avidspartan1 Sep 18 '15 at 13:44

0 Answers0