Re: problems with Gtk::ComboBoxText and Gtk::Builder



Hi,

No, I don't think you are doing anything wrong. I think the critical
message is a result of the problem discussed in the bugs
https://bugzilla.gnome.org/show_bug.cgi?id=653579 (gtkmm) and
https://bugzilla.gnome.org/show_bug.cgi?id=650369 (gtk+).

You can check, if it helps to add
  combo->set_entry_text_column(0);
  combo->set_id_column(1);
before combo->append("id", "text").

It shouldn't be necessary to do this. The gtk+ class GtkComboBoxText is
written in such a way that a new object is initialized correctly, if
it's allocated with gtk_combo_box_text_new(), but not if it's allocated
with g_object_new[v]() without explicitly setting the properties
entry-text-column and id-column. GtkBuilder uses g_object_newv().

If my suspicion is correct, it's yet another reason why Claudio
Saavedra's patch in bug 650369, comment 3 ought to be committed.

Kjell

fre 2011-09-23 klockan 12:06 +0200 skrev Stefano Facchini:
> Hi,
> 
> I have the following code:
> 
>   Gtk::ComboBoxText *combo;
>   builder->get_widget ("some_combo", combo);
>   combo->append ("id", "text");
> 
> with the corresponding fragment in .UI file
>   <object class="GtkComboBoxText" id="some_combo>
>   </object>
> 
> When executed, the program gives:
> 
> Gtk-CRITICAL **: gtk_combo_box_text_insert: assertion `id_column >= 0'
> failed
> 
> The ComboBox seems to be created because it appears in the window.
> I don't get the same problem if the ComboBoxText is allocated manually 
> 
>   Gtk::ComboBoxText *combo;
>   combo = new Gtk::ComboBoxText ();
>   combo->append ("id", "text");
> 
> ---> NO ERROR
> 
> Am I doing something wrong with Gtk::Builder?
> 
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list




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