After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 88630 - Menu::popup() and item activation
Menu::popup() and item activation
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
2.0
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2002-07-19 17:12 UTC by Jarek Dukat
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example for above bug (1.35 KB, text/plain)
2002-07-19 17:17 UTC, Jarek Dukat
Details
Slightly modified example (1.51 KB, text/plain)
2002-07-31 12:02 UTC, Andreas Holzmann
Details

Description Jarek Dukat 2002-07-19 17:12:38 UTC
First I must notice that I'm not sure if it is a bug, a feature or perhaps
a Gtk+ issue.
When I create a popup menu with submenus subitems are not always activated.
For example I have a menu:
------
Item 1
Item 2 ---------
       SubItem 1
       SubItem 2
All items and subitems have on_activate signals connected.
When I popup a menu using: menu->popup(*window, 3, 0);
(3 is right mouse button), Item1 is activated no matter if I click it with
left, middle or right mouse button. But subitems only are activated with
right mouse button. Clicks with other buttons just close the menu. Replace
3 with 0 in popup() call and all items and subitems will be activated by
any button.
Such behaviour is a little strange. I think either all items should be
activated with any button, or all with only one button.
If it is not Gtkmm problem then I'm really sorry for trouble. I created a
simple example showing this problem. It would be very useful if someone
rewrote it in Gtk+ and test it then.
Comment 1 Jarek Dukat 2002-07-19 17:17:27 UTC
Created attachment 9970 [details]
Example for above bug
Comment 2 Murray Cumming 2002-07-19 19:57:48 UTC
I won't investigate this until someone proves that it's gtkmm only.
Comment 3 Andreas Holzmann 2002-07-31 12:01:28 UTC
Gtk+ does exactly the same.

Note that you shouldn't connect the popup action to the clicked signal.
Please connect it to the button_press signal. Then you get the right
parameters for the popup method from the GdkEventButton and 
you can do press-move-release actions to activate a popup menu item.

I'll attach a slightly modified version of your example attachment.
Comment 4 Andreas Holzmann 2002-07-31 12:02:52 UTC
Created attachment 10147 [details]
Slightly modified example
Comment 5 Murray Cumming 2002-07-31 13:11:31 UTC
Thanks Andreas. Well done.

Of course buttons are for clicking, not right-clicking.