gnome-sharp 2.20.0.0 2.24.0.0 Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. System.Object Create and display popup and context menus. `using System; using Gtk; using GtkSharp; using Gnome; class PopupSample { Program program; static void Main (string[] args) { new PopupSample (args); } PopupSample (string[] args) { program = new Program ("PopupSample", "0.0", Modules.UI, args); App app = new App ("PopupSample", "Gnome.Popup sample"); app.SetDefaultSize (400, 300); app.DeleteEvent += new DeleteEventHandler (OnAppDelete); Menu menu = new Menu (); MenuItem hello = new MenuItem ("Hello"); hello.Activated += new EventHandler (OnHelloActivated); hello.Show (); menu.Append (hello); Label label = new Label ("Right Click me"); EventBox eventbox = new EventBox (); eventbox.Add (label); app.Contents = eventbox; Popup.MenuAttach (menu, eventbox, IntPtr.Zero); app.ShowAll (); program.Run (); } private void OnHelloActivated (object o, EventArgs args) { Console.WriteLine ("Hello Activated"); } private void OnAppDelete (object o, DeleteEventArgs args) { program.Quit (); } }`
- Constructor
  2.24.0.0
  Creates a new instance.
  The default constructor for .
- Method
  2.24.0.0
  System.Obsolete
  System.Void `` `` a a Appends the menu items in to the menu.
- Method
  2.24.0.0
  System.Obsolete
  System.Void `` `` `` a a a Attaches the specified menu to the specified .

  The menu can then be activated by pressing mouse button 3 over the widget. When a menu item callback is invoked, the specified will be passed to it.

  This function requires the widget to have its own window (i.e. ), This function will try to set the flag on the event mask for the widget if it does not have it yet. If this is the case, then the widget must not be realized for it to work.

  The popup menu can be attached to different widgets at the same time. A reference count is kept on the popup menu; when all the widgets it is attached to are destroyed, the popup menu will be destroyed as well.

  Under the current implementation, setting a popup menu for a widget and then reparenting that widget will cause Bad Things to happen.

- Method
  2.24.0.0
  System.Obsolete
  System.Void `` `` `` `` `` a a a a a You can use this function to pop up a menu.

  When a menu item callback is invoked, the specified user_data will be passed to it.

  The parameter is the same as for , i.e. you can use it to specify a function to position the menu explicitly. If you want the default position (near the mouse), pass .

  The event parameter is needed to figure out the mouse button that activated the menu and the time at which this happened. If you pass in , then no button and the current time will be used as defaults.

- Method
  2.24.0.0
  System.Obsolete
  System.Void `` `` `` `` `` `` a a a a a a Obsolete. Replaced by overload with no argument.
- Method
  2.24.0.0
  System.Obsolete
  System.Int32 `` `` `` `` `` a a a a a You can use this function to pop up a menu modally. a Same as , but modal.
- Method
  2.24.0.0
  System.Obsolete
  System.Int32 `` `` `` `` `` `` a a To be added. a a a Obsolete. Replaced by overload with no argument. a
- Method
  2.24.0.0
  System.Obsolete
  Gtk.AccelGroup `` a This function is used to retrieve the accelgroup that was created by . a If you want to specify the accelgroup that the popup menu accelerators use, then use .
- Method
  2.24.0.0
  System.Obsolete
  Gtk.Widget `` a Creates a popup menu out of the specified array. a This method behaves just like , except that it creates an for you and attaches it to the menu object. Use to get the that is created.
- Method
  2.24.0.0
  System.Obsolete
  Gtk.Widget `` `` a a Creates a popup menu out of the specified array. a Use to pop the menu up, or attach it to a window with .