GNOME Bugzilla – Bug 604868
Having toplevel items duplicated as leaves in GtkComboBox should be configurable
Last modified: 2009-12-19 10:29:44 UTC
Created attachment 149948 [details] Patch that adds "duplicate-toplevels" property When GtkTreeView serves as a model for combo box, toplevel items are always duplicated as leaves in order to make them selectable. This behavior should probably be made optional, since in many situations selecting toplevel item is not desirable. For example, I help maintaining slideshow application that uses combo box to list available transitions. Similar transitions are grouped into families and in combo box, family name is toplevel item with real transitions listed as subitems. Having family name selectable in this case makes no sense and in code we actually monitor if user selected family name and automatically change active selection from family name to first transition in this family. I would propose addition of new property that would enable developers to control when toplevel items are also displayed in submenu. Adding this property would not affect existing applications that depend on this behavior, since removal of duplicate toplevel item would require developer's intervention. I attached a patch against latest git master that adds this simple property (I named it "duplicate-toplevels" for the time being). Tadej
Look at the combobox example in gtk-demo for an example of how to do this.
Hello all. Sorry for not doing my homework before reporting bug. Tadej