[Glade-users] Bug in glade, GtkComboBox, repeatable.



ok, make a simple glade project, and a matching libglade code project 
(my lang is  C++, my platform is win32, perhaps it's platform dependant? 
anyone test this on linux?).

add a combo box to your window.

in your libglade project, use the following code in your main function

GtkWidget *w = glade_xml_get_widget(xmlfile,"combobox");
gtk_combo_box_append_text(GTK_COMBO_BOX(w),"my text");

compile + run the app, in the console, you'll notice this appear

(Application.exe): Gtk-CRITICAL **: gtk_combo_box_append_text: assertion 
'GTK_IS_LIST_STORE(combo_box->priv->model)' failed

hmm, whats going on? ok, open your glade file in your text editor, find 
the part of the xml which describes your combobox, you'll find something 
similar.

<widget class="GtkComboBox" id="combobox2">
       <property name="visible">True</property>
</widget>

thats what I have.  You'll notice a lack of <property name="items"...>

now, reopen your glade project, click the Items entry box, enter a key, 
say "g" delete that "g" character, save it and reopen it in your text 
editor!

<widget class="GtkComboBox" id="combobox2">
        <property name="visible">True</property>
        <property name="items" translatable="yes"></property>
</widget>

oh, well hello, now we have a items property chunk, now without even 
recompiling your code, attempt to run the executable again

no error output this time? you've just solved your problem, the combo 
box will appear and you'll find "my text" a selectable option.

Therefore, to sum up, glade is not automatically adding a "items" 
property to the widget xml, even though it's REQUIRED by libglade and 
probably safe to add anyway.

someone developing glade, please fix this, thanks!

chris




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