Sorry to jump into this discussion so late - I only caught up with it today! Havoc wrote: > Also, chatting around the labs Owen still expressed misgivings about > the right thing to do on the combo box. The issue is basically: should > we have a new widget that is an option menu, but does not expose the > use of GtkMenu, and according to the theme can look like either an > option menu or a Windows-style non-editable combo. If we do have that > new widget, should we still have this combo box. This is something which has caused me a bit of 'distress' :-) .... should I go for an optionmenu or a combo box? My feelings are that Owen's right to be at least considering another widget. I reckon there are four cases where applications require a 'select item from list' type of widget: (1) Menu bars & popup menus .... mainly used for command-type functions (2) Option menus .... for selecting from a small set of, well, 'options' to control the behaviour of the application (3) History list for a text entry (4) Selecting from a potentially large set of objects from application data, where you don't want users to be free to type anything they like (people have been using combos for this, with editing of the entry disabled). I guess that you've been discussing which widget to use for case 4, which I don't think has ever been completely satisfactory. If you use an option menu, it'll try to size itself to the longest menu item at the time it's realized. Also it's tricky to get 'nth item in dynamic list' from this (although you can set object data on the menu items). If you use a combo box, (AFAIK) you can only use string comparison on the contents of the text entry, to find the item which has been selected. This way, you MUST have unique names in the list (the user may have a couple of untitled objects, and intends to go back and fill in the details later). A while back, I hacked up a widget intended for this, although I never finished it - no vertical scrollbar, no sensible positioning of the dropdown list if it's too near the bottom of the screen, but I've attached it anyway, just to show the appearance of it - similar style to the combo box, different enough for it to be obvious that it performs a different function. (main.c wraps a test program around it). Any thoughts (not necessarily on the attached widget .... on the need for a large-dynamic-menu type of widget)? Allan
Attachment:
gtkchoice.tar.gz
Description: GNU Zip compressed data