Eric Jardim schrieb:
Hi, all...
What do you know about this "popup-menu" event of the gtk.Widget class?
Why it is not activated when someone right-click the widget?
Anyway, it still can be stimulated by a method calling, isn't it?
Why do people have to do catch the button_press_event, what is a
little low level?
Looking at Qt, the QWidget class has a "QWidget::contextMenuEvent"
method that you just override and do what you want.
Why does GTK does not has something similar?
What do you have to say about all this?
[Eric Jardim]
Having thought a little about your question I realize that these two
events are different, also from a user's point of view:
- You can right click on a widget. Often this is a treeview widget.
Then you might have a modifier key pressed down so that e.g. you select
the item that you clicked on as well before calling the popup menu.
- You can push the key on your keyboard that has the little popup menu
sign. When you do this, there is no way to change the selection that
the popup menu is referring to.
So basically these really are two different actions.
You can easily set up button_press_event to call the same method as the
"popup-menu" event. This way you can have the same popup code for both
a mouse click and for the popup key on your keyboard.
Niklas Volbers.
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/