<Type Name="Popup" FullName="Gnome.Popup">
  <TypeSignature Language="C#" Value="public class Popup" Maintainer="John Luke" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit Popup extends System.Object" />
  <AssemblyInfo>
    <AssemblyName>gnome-sharp</AssemblyName>
    <AssemblyPublicKey>
    </AssemblyPublicKey>
    <AssemblyVersion>2.20.0.0</AssemblyVersion>
    <AssemblyVersion>2.24.0.0</AssemblyVersion>
  </AssemblyInfo>
  <ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
  <Base>
    <BaseTypeName>System.Object</BaseTypeName>
  </Base>
  <Interfaces />
  <Docs>
    <summary>Create and display popup and context menus.</summary>
    <remarks>
    </remarks>
    <example>
      <code language="C#">
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 ();
	}
}
	  </code>
    </example>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public Popup ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.24.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue />
      <Parameters />
      <Docs>
        <summary>Creates a new <see cref="T:Gnome.Popup" /> instance.</summary>
        <remarks>The default constructor for <see cref="T:Gnome.Popup" />.</remarks>
      </Docs>
    </Member>
    <Member MemberName="MenuAppend">
      <MemberSignature Language="C#" Value="public static void MenuAppend (Gtk.Widget popup, Gnome.UIInfo uiinfo);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void MenuAppend(class Gtk.Widget popup, valuetype Gnome.UIInfo uiinfo) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.24.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.Obsolete</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="popup" Type="Gtk.Widget" />
        <Parameter Name="uiinfo" Type="Gnome.UIInfo" />
      </Parameters>
      <Docs>
        <param name="popup">a <see cref="T:Gtk.Widget" /></param>
        <param name="uiinfo">a <see cref="T:Gnome.UIInfo" /></param>
        <summary>Appends the menu items in <paramref name="uiinfo" /> to the <paramref name="popup" /> menu.</summary>
        <remarks>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="MenuAttach">
      <MemberSignature Language="C#" Value="public static void MenuAttach (Gtk.Widget popup, Gtk.Widget widget, IntPtr user_data);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void MenuAttach(class Gtk.Widget popup, class Gtk.Widget widget, native int user_data) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.24.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.Obsolete</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="popup" Type="Gtk.Widget" />
        <Parameter Name="widget" Type="Gtk.Widget" />
        <Parameter Name="user_data" Type="System.IntPtr" />
      </Parameters>
      <Docs>
        <param name="popup">a <see cref="T:Gtk.Widget" /></param>
        <param name="widget">a <see cref="T:Gtk.Widget" /></param>
        <param name="user_data">a <see cref="T:System.IntPtr" /></param>
        <summary>Attaches the specified <paramref name="popup" /> menu to the specified <paramref name="widget" />.</summary>
        <remarks>
          <para>The menu can then be activated by pressing mouse button 3 over the widget. When a menu item callback is invoked, the specified <paramref name="user_data" /> will be passed to it.</para>
          <para>This function requires the widget to have its own window (i.e. <see cref="F:Gtk.WidgetFlags.NoWindow" />), This function will try to set the <see cref="F:Gdk.EventMask.ButtonPressMask" /> 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.</para>
          <para>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.</para>
          <para>Under the current implementation, setting a popup menu for a <see cref="F:Gtk.WidgetFlags.NoWindow" /> widget and then reparenting that widget will cause Bad Things to happen.</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="MenuDoPopup">
      <MemberSignature Language="C#" Value="public static void MenuDoPopup (Gtk.Widget popup, Gtk.MenuPositionFunc pos_func, Gdk.EventButton evnt, IntPtr user_data, Gtk.Widget for_widget);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void MenuDoPopup(class Gtk.Widget popup, class Gtk.MenuPositionFunc pos_func, class Gdk.EventButton evnt, native int user_data, class Gtk.Widget for_widget) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.24.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.Obsolete</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="popup" Type="Gtk.Widget" />
        <Parameter Name="pos_func" Type="Gtk.MenuPositionFunc" />
        <Parameter Name="evnt" Type="Gdk.EventButton" />
        <Parameter Name="user_data" Type="System.IntPtr" />
        <Parameter Name="for_widget" Type="Gtk.Widget" />
      </Parameters>
      <Docs>
        <param name="popup">a <see cref="T:Gtk.Widget" /></param>
        <param name="pos_func">a <see cref="T:Gtk.MenuPositionFunc" /></param>
        <param name="evnt">a <see cref="T:Gdk.EventButton" /></param>
        <param name="user_data">a <see cref="T:System.IntPtr" /></param>
        <param name="for_widget">a <see cref="T:Gtk.Widget" /></param>
        <summary>You can use this function to pop up a menu.</summary>
        <remarks>
          <para>When a menu item callback is invoked, the specified user_data will be passed to it.</para>
          <para>The <paramref name="pos_func" /> parameter is the same as for <see cref="M:Gtk.Menu.Popup(Gtk.Widget,Gtk.MenuPositionFunc,System.IntPtr,Gdk.EventButton,System.IntPtr,Gtk.Widget)" />, 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 <see langword="null" />.</para>
          <para>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 <see langword="null" />, then no button and the current time will be used as defaults.</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="MenuDoPopup">
      <MemberSignature Language="C#" Value="public static void MenuDoPopup (Gtk.Widget popup, Gtk.MenuPositionFunc pos_func, IntPtr data, Gdk.EventButton evnt, IntPtr user_data, Gtk.Widget for_widget);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig void MenuDoPopup(class Gtk.Widget popup, class Gtk.MenuPositionFunc pos_func, native int data, class Gdk.EventButton evnt, native int user_data, class Gtk.Widget for_widget) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.24.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.Obsolete</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="popup" Type="Gtk.Widget" />
        <Parameter Name="pos_func" Type="Gtk.MenuPositionFunc" />
        <Parameter Name="data" Type="System.IntPtr" />
        <Parameter Name="evnt" Type="Gdk.EventButton" />
        <Parameter Name="user_data" Type="System.IntPtr" />
        <Parameter Name="for_widget" Type="Gtk.Widget" />
      </Parameters>
      <Docs>
        <param name="popup">a <see cref="T:Gtk.Widget" /></param>
        <param name="pos_func">a <see cref="T:Gtk.MenuPositionFunc" /></param>
        <param name="data">a <see cref="T:System.IntPtr" /></param>
        <param name="evnt">a <see cref="T:Gdk.EventButton" /></param>
        <param name="user_data">a <see cref="T:System.IntPtr" /></param>
        <param name="for_widget">a <see cref="T:Gtk.Widget" /></param>
        <summary>Obsolete. Replaced by overload with no <see cref="T:System.IntPtr" /> argument.</summary>
        <remarks />
      </Docs>
    </Member>
    <Member MemberName="MenuDoPopupModal">
      <MemberSignature Language="C#" Value="public static int MenuDoPopupModal (Gtk.Widget popup, Gtk.MenuPositionFunc pos_func, Gdk.EventButton evnt, IntPtr user_data, Gtk.Widget for_widget);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig int32 MenuDoPopupModal(class Gtk.Widget popup, class Gtk.MenuPositionFunc pos_func, class Gdk.EventButton evnt, native int user_data, class Gtk.Widget for_widget) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.24.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.Obsolete</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>System.Int32</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="popup" Type="Gtk.Widget" />
        <Parameter Name="pos_func" Type="Gtk.MenuPositionFunc" />
        <Parameter Name="evnt" Type="Gdk.EventButton" />
        <Parameter Name="user_data" Type="System.IntPtr" />
        <Parameter Name="for_widget" Type="Gtk.Widget" />
      </Parameters>
      <Docs>
        <param name="popup">a <see cref="T:Gtk.Widget" /></param>
        <param name="pos_func">a <see cref="T:Gtk.MenuPositionFunc" /></param>
        <param name="evnt">a <see cref="T:Gdk.EventButton" /></param>
        <param name="user_data">a <see cref="T:System.IntPtr" /></param>
        <param name="for_widget">a <see cref="T:Gtk.Widget" /></param>
        <summary>You can use this function to pop up a menu modally.</summary>
        <returns>a <see cref="T:System.Int32" /></returns>
        <remarks>Same as <see cref="M:Gnome.Popup.MenuDoPopup()" />, but modal.</remarks>
      </Docs>
    </Member>
    <Member MemberName="MenuDoPopupModal">
      <MemberSignature Language="C#" Value="public static int MenuDoPopupModal (Gtk.Widget popup, Gtk.MenuPositionFunc pos_func, IntPtr data, Gdk.EventButton evnt, IntPtr user_data, Gtk.Widget for_widget);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig int32 MenuDoPopupModal(class Gtk.Widget popup, class Gtk.MenuPositionFunc pos_func, native int data, class Gdk.EventButton evnt, native int user_data, class Gtk.Widget for_widget) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.24.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.Obsolete</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>System.Int32</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="popup" Type="Gtk.Widget" />
        <Parameter Name="pos_func" Type="Gtk.MenuPositionFunc" />
        <Parameter Name="data" Type="System.IntPtr" />
        <Parameter Name="evnt" Type="Gdk.EventButton" />
        <Parameter Name="user_data" Type="System.IntPtr" />
        <Parameter Name="for_widget" Type="Gtk.Widget" />
      </Parameters>
      <Docs>
        <param name="popup">a <see cref="T:Gtk.Widget" /></param>
        <param name="pos_func">a <see cref="T:Gtk.MenuPositionFunc" /></param>
        <param name="data">To be added.</param>
        <param name="evnt">a <see cref="T:Gdk.EventButton" /></param>
        <param name="user_data">a <see cref="T:System.IntPtr" /></param>
        <param name="for_widget">a <see cref="T:Gtk.Widget" /></param>
        <summary>Obsolete. Replaced by overload with no <see cref="T:System.IntPtr" /> argument.</summary>
        <returns>a <see cref="T:System.Int32" /></returns>
        <remarks />
      </Docs>
    </Member>
    <Member MemberName="MenuGetAccelGroup">
      <MemberSignature Language="C#" Value="public static Gtk.AccelGroup MenuGetAccelGroup (Gtk.Menu menu);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig class Gtk.AccelGroup MenuGetAccelGroup(class Gtk.Menu menu) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.24.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.Obsolete</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>Gtk.AccelGroup</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="menu" Type="Gtk.Menu" />
      </Parameters>
      <Docs>
        <param name="menu">a <see cref="T:Gtk.Menu" /></param>
        <summary>This function is used to retrieve the accelgroup that was created by <see cref="M:Gnome.Popup.MenuNew(Gnome.UIInfo)" />.</summary>
        <returns>a <see cref="T:Gtk.AccelGroup" /></returns>
        <remarks>If you want to specify the accelgroup that the popup menu accelerators use, then use <see cref="M:Gnome.Popup.MenuNewWithAccelgroup(Gnome.UIInfo,Gtk.AccelGroup)" />.</remarks>
      </Docs>
    </Member>
    <Member MemberName="MenuNew">
      <MemberSignature Language="C#" Value="public static Gtk.Widget MenuNew (Gnome.UIInfo uiinfo);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig class Gtk.Widget MenuNew(valuetype Gnome.UIInfo uiinfo) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.24.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.Obsolete</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>Gtk.Widget</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="uiinfo" Type="Gnome.UIInfo" />
      </Parameters>
      <Docs>
        <param name="uiinfo">a <see cref="T:Gnome.UIInfo" /></param>
        <summary>Creates a popup menu out of the specified <paramref name="uiinfo" /> array.</summary>
        <returns>a <see cref="T:Gtk.Widget" /></returns>
        <remarks>This method behaves just like <see cref="M:Gnome.Popup.MenuNewWithAccelgroup()" />, except that it creates an <see cref="T:Gtk.AccelGroup" /> for you and attaches it to the menu object. Use <see cref="M:Gnome.Popup.MenuGetAccelGroup(Gtk.Menu)" /> to get the <see cref="T:Gtk.AccelGroup" /> that is created.</remarks>
      </Docs>
    </Member>
    <Member MemberName="MenuNewWithAccelgroup">
      <MemberSignature Language="C#" Value="public static Gtk.Widget MenuNewWithAccelgroup (Gnome.UIInfo uiinfo, Gtk.AccelGroup accelgroup);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig class Gtk.Widget MenuNewWithAccelgroup(valuetype Gnome.UIInfo uiinfo, class Gtk.AccelGroup accelgroup) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.24.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.Obsolete</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>Gtk.Widget</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="uiinfo" Type="Gnome.UIInfo" />
        <Parameter Name="accelgroup" Type="Gtk.AccelGroup" />
      </Parameters>
      <Docs>
        <param name="uiinfo">a <see cref="T:Gnome.UIInfo" /></param>
        <param name="accelgroup">a <see cref="T:Gtk.AccelGroup" /></param>
        <summary>Creates a popup menu out of the specified <paramref name="uiinfo" /> array.</summary>
        <returns>a <see cref="T:Gtk.Widget" /></returns>
        <remarks>Use <see cref="M:Gnome.Popup.MenuDoPopup(Gtk.Widget,Gtk.MenuPositionFunc, System.IntPtr,Gdk.EventButton,System.IntPtr,Gtk.Widget)" /> to pop the menu up, or attach it to a window with <see cref="M:Gnome.Popup.MenuAttach(Gtk.Widget,Gtk.Widget,System.IntPtr)" />.</remarks>
      </Docs>
    </Member>
  </Members>
</Type>
