Re: Implementing mac-style context menus



Tommi Komulainen <tommi komulainen nokia com> writes:

Now, in practice I'm getting in trouble very quickly.

1.  With the above naive implementation the context menu is popped up
and it grabs the focus before the button-release-event is emitted.  This
apparently makes the widget miss the event and is left in somewhat
inconsistent state.  The effects are visible after dismissing the popup
menu (releasing the grab.)

With GtkButton this means that it's drawn in depressed state the next
time the cursor hovers over the button.  With GtkEntry it starts a drag.


2. If instead I fake a button-release-event before showing the popup
menu GtkButton emits an extra 'clicked' signal, and the GtkEntry still
starts a drag.


Any hints, what am I doing wrong?

Just a guess, but are you sure you are passing in the correct "button"
and "time" parameters? I don't really see any other reason this should
be different from the usual "pop up immediately when you press the
button".


Søren



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