GNOME Bugzilla – Bug 165227
ComboBox's popup items wrongly positioned
Last modified: 2011-01-16 23:33:37 UTC
Please describe the problem: When activating a combo box whose items are too numerous to fit the space left below it (down until the bottom of the desktop), the items are wrongly positioned on the popup menu. It is as if the popup menu shown has the correct dimensions, but the items are not rendered beginning from the top of it, causing an empty area to appear on the top and the little arrow to allow scrolling the items at the bottom. Steps to reproduce: 1. Add a ComboBox widget to a window. 2. Enter a considerable number of items for it; 20, say. 3. In your application, use libglademm to load the widget. 4. Upon runtime, try activating the combo box with its parent window positioned at different heights with relation to the desktop. Actual results: Depending on the position of the combo box widget with regards to the desktop, its items will appear vertically displaced when the combo box is activated. Expected results: The combo box's items should occupy the whole area of the popup menu and scrolling arrows should be displayed only if necessary, that is, if the total number of items were so large that they would not fit in an area as large as the desktop's height. Does this happen every time? Yes. Other information: I have taken 2 screenshots of my application where the problem is depicted: 1) The dialog box containing the combo box widget http://zunino.eti.br/tests/gtkmm/comboboxtext/comboboxtext-1.png 2) The combo box having been activated; notice the blank area at the top. http://zunino.eti.br/tests/gtkmm/comboboxtext/comboboxtext-2.png Note: There is actually another issue, which is that the items entered in Glade are being duplicated (two per line), but I won't mix things up. In any case, I would appreciate if someone knew the reason and dropped me a line.
Can you reproduce this with a C application? > Note: There is actually another issue, which is that the items entered in Glade > are being duplicated (two per line) So, please put that in another gnomemm (libglademm component) bug.
This is on purpose, and is discussed in bug #129463. For the record, I agree with you : it looks weird :) *** This bug has been marked as a duplicate of 129463 ***
Murray Cumming wrote on comment #1: > So, please put that in another gnomemm (libglademm component) bug. I was about to do so, but then I found a solution (or a workaround, at least): I used the Gtk::ComboBox::set_wrap_width() member with an argument of 1, which caused the items to be displayed as desired: only 1 per row. This had two noticeable side-effects: 1) the width of the popup menu shrank to become only wide enough to hold the widest item; and 2) the empty-area-on-the-top issue was no longer there. Now, I am not sure these side-effects are supposed to have taken place as a consequence of using set_wrap_width(), but I thought I would mention them here for documentation purposes. Regards.