After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 590005 - GtkComboBoxEntry unable to set text-columns from GtkBuilder
GtkComboBoxEntry unable to set text-columns from GtkBuilder
Status: RESOLVED DUPLICATE of bug 564160
Product: gtk+
Classification: Platform
Component: Widget: Other
2.17.x
Other All
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-07-28 12:47 UTC by Daniel Svensson
Modified: 2009-09-22 11:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch + test case (2.62 KB, patch)
2009-07-28 13:04 UTC, Daniel Svensson
reviewed Details | Review
patch + test case (updated description) (2.80 KB, patch)
2009-09-15 10:45 UTC, Daniel Svensson
none Details | Review

Description Daniel Svensson 2009-07-28 12:47:50 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
Comment 1 Daniel Svensson 2009-07-28 13:04:17 UTC
Created attachment 139380 [details] [review]
patch + test case
Comment 2 Owen Taylor 2009-09-04 18:45:53 UTC
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.)
Comment 3 Daniel Svensson 2009-09-15 10:45:18 UTC
Created attachment 143223 [details] [review]
patch + test case (updated description)
Comment 4 Daniel Svensson 2009-09-18 07:57:46 UTC
Is the commit message ok now? Was there anything else you wanted me to fix before getting this fix in?
Comment 5 Daniel Svensson 2009-09-22 11:46:27 UTC

*** This bug has been marked as a duplicate of bug 564160 ***