Re: question about combo box



Georg Fritzsche wrote:

   I  have a question about GtkcomboBox
   You know,every combobox have a GList which stores
some optional item.
   My problem is about the GList.
   When I click the triangle to pull down the list,
        and move my mouse to select item,
        the highlight item didn't change from one
item to another when my mouse moves from one item to
another.
   The thing I want is that: when my mouse is on item
A,the highlight item is item A; when my mouse is on
item B,the highlight itme is item B.
   How can i do that ?


Simple answer: don't just single-click the triangle but keep the
mouse button pressed while moving down over the popup list.

funny thing, for me it works both ways...
either i misunderstood what exactly the desired behaviour is or the
problem is not gtk-, but windowmanager-dependent.

I've been verifying the behaviour on both GTK 1.x and GTK+ 2.x
applications. With a single click on the dropdown button of a combobox,
the list expands but no automatic highlight takes place. With the mouse
button kept pressed, automatic highlighting of the item below the mouse
pointer takes place. I don't think this behaviour can be controlled by a
window manager, except perhaps by a really dirty one. I'd rather
consider whether there is a (hidden?) Gnome / GTK+ setting to change the
behaviour after all? I'm not aware of any, at least.

Btw, menus, both dropdown and popup, fulfill the behaviour Yeajchao was
asking for: highlighting the current entry below the mouse pointer
without the mouse button being pressed.

I think there is a good reason for comboboxes not to to auto-highlight
the selected entries without explicit mouse press: highlighting of
combobox list entries goes along with changing the contents of the
associated text field. Often this may be undesired. Sometimes you only
want to study what entries are available in a list, possibly with
assistance of the mouse pointer moving over them, but you don't want to
change the actual (pre)selection. This would not be possible (selection
would always change) if there was mouse-button-independent
auto-highlighting in combobox lists. In menus there is no such thing
like (pre)selection change, so automatic highlighting of entries even
without mouse button presses is acceptable there.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]