Reputation: 6255
ALL, In GTK+ there is a widget called GtkComboBox. I don't know the implementation details but on Windows it consists of 2 widgets: text control and list control. There is also a little button to the right of the text control. If you click that button, the list control pops up.
My question is: how do I detect the mouse click on that button in GtkComboBox? Is such click even emits the signal that can be caught or it just sends the popdown signal to the GtkComboBox widget and eats the mouse click?
BTW is it a composite widget in GTK+ as well?
An example on any language would be much helpful.
Thank you.
Upvotes: 3
Views: 1645
Reputation: 11963
The GtkComboBox does in fact "eat the mouse click" and I think it will be quite tricky to get the behavior you are looking for without modifying or subclassing the GtkComboBox widget. I wouldn't rely on the GtkComboBox being a composite widget or not - that seems like an implementation detail that could change.
It seems like you're paddling upstream if you really want to capture mouse clicks on the combo box - after all, there are other ways for users to use the widget (with the keyboard, for example). The GtkComboBox emits a changed
signal whenever the selection changes - could you use that in your application?
Upvotes: 2