[Glade-users] simple comboboxentry app fails



2010/4/19 Mathew Yeates <mat.yeates at gmail.com>:
Why is this failing?
import gtk
builder = gtk.Builder()
builder.add_from_file("cbe.glade")
win=builder.get_object("window1")
win.connect("destroy", lambda x: gtk.main_quit())
win.show()
gtk.main()
<?xml version="1.0"?>
<interface>
??<requires lib="gtk+" version="2.16"/>
??<!-- interface-naming-policy project-wide -->
??<object class="GtkWindow" id="window1">
?? ?<child>
?? ? ?<object class="GtkComboBoxEntry" id="comboboxentry1">
?? ? ? ?<property name="visible">True</property>
?? ? ?</object>
?? ?</child>
??</object>
??<object class="GtkListStore" id="liststore1">
?? ?<columns>
?? ? ?<!-- column-name col1 -->
?? ? ?<column type="gchararray"/>
?? ?</columns>
?? ?<data>
?? ? ?<row>
?? ? ? ?<col id="0" translatable="yes">dog</col>
?? ? ?</row>
?? ? ?<row>
?? ? ? ?<col id="0" translatable="yes">cat</col>
?? ? ?</row>
?? ?</data>
??</object>
</interface>

_______________________________________________
Glade-users maillist ?- ?Glade-users at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-users

You must associate ListStore to ComboBox:

<?xml version="1.0"?>
<interface>
  <requires lib="gtk+" version="2.16"/>
  <!-- interface-naming-policy project-wide -->
  <object class="GtkWindow" id="window1">
    <child>
      <object class="GtkComboBoxEntry" id="comboboxentry1">
        <property name="visible">True</property>
        <property name="model">liststore1</property>
        <property name="text_column">0</property>
      </object>
    </child>
  </object>
  <object class="GtkListStore" id="liststore1">
    <columns>
      <!-- column-name col1 -->
      <column type="gchararray"/>
    </columns>
    <data>
      <row>
        <col id="0" translatable="yes">dog</col>
      </row>
      <row>
        <col id="0" translatable="yes">cat</col>
      </row>
    </data>
  </object>
</interface>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]