GNOME Bugzilla – Bug 590005
GtkComboBoxEntry unable to set text-columns from GtkBuilder
Last modified: 2009-09-22 11:46:27 UTC
Please describe the problem: According to the documentation of GtkCombBoxEntry text-column property the value has >= G_MAXULONG as its only range restriction. This is however not true as the gtk_combo_box_entry_set_text_column function also checks the number of columns available before accepting the value. The problem occurs when creating a GtkComboBoxEntry with GtkBuilder as the text-column property is set before the model property. It could be argued that this restriction should remain, however it can be circumvented by creating a GtkCellRendererText child in the ui specification that points to an arbitrary non-checked column. The patch attached removes the column check and blindly accepts the text-column setting. Steps to reproduce: See test case in the attached patch. Actual results: Expected results: Does this happen every time? Other information: http://library.gnome.org/devel/gtk/stable/GtkComboBoxEntry.html#GtkComboBoxEntry--text-column
Created attachment 139380 [details] [review] patch + test case
Comment on attachment 139380 [details] [review] patch + test case Looks good to me. You can't assume ordering of setting various properties (model and tree column) so the check seems premature. Won't crash if the column is set wrong, since gtk_tree_model_get() will do the check later. (The warning message will be a little more confusing, but not a big deal.) Patch does need a real commit message (the subject of the commit should explain what the patch does and why. The patch should contain a reference to this bug.)
Created attachment 143223 [details] [review] patch + test case (updated description)
Is the commit message ok now? Was there anything else you wanted me to fix before getting this fix in?
*** This bug has been marked as a duplicate of bug 564160 ***