[Gtk-sharp-list] Popup menu on DrawingArea

Dan Winship danw@novell.com
Tue, 19 Apr 2005 09:43:09 -0400


On Tue, 2005-04-19 at 12:26 +0200, Thomas Zühlke wrote:
> Hi *,
> 
> i must assign a Popup-Menu to a DrawingArea. And i can't find any help
> in Mono-Doc or a Gtk-Sample. I have already used a menu in a Gtk.Window
> and this works fine, but i haven't any idea how to assign a Popup-Menu
> to Gtk.DrawingArea.

http://developer.gnome.org/doc/API/2.0/gtk/gtk-migrating-checklist.html#checklist-popup-menu
shows what to do in C. Basically you need to connect to the
ButtonPressEvent and PopupMenu signals, create a Gtk.Menu, and call
Popup on it. (If you are subclassing DrawingArea, you'd do this by
overriding OnButtonPressEvent and OnPopupMenu.)

-- Dan