Search code examples
pythongtkpygtk

gtk ComboBoxEntry.get_child() returns none


I have a problem with the gtk ComboBoxEntry. My program crashes when I try to change the text in the combobox. I use this code:

   gui.combo_txt_script.get_child().set_text(fshort)

It crashes with the error:

AttributeError: 'NoneType' object has no attribute 'set_text'

The results of the following prints:

   print "combo:",gui.combo_txt_script
   print "entry:",gui.combo_txt_script.get_child()

is

combo: <gtk.ComboBoxEntry object at ... >
entry: None

Solution

  • I found the problem. The program I use has different user levels. Every tab and thus every widget is not visible for every user level. Somehow, it happened that the user level could change by itself, which made the combo non existent.