Ryujinx-GtkSharp/doc/en/Gnome/Popup.xml
Dan Winship 6bf7376094 * parser/gapi2xml.pl (addParamsElem): change the handling of
anonymous function pointer types in method signatures. Before, we
	added a <callback> child to the <parameters> node, but the
	generator just ignored it. Now we add the callback (with a made-up
	name) to the toplevel node, and add an ordinary <param> node
	referencing it to the <parameters> node. Also, if the last param
	of the callback is a gpointer, rename it from "arg#" to "data" so
	it will be treated correctly (as the user data passed from the
	calling method). [Fixes #66241]

	* art/art-api.raw: 
	* gdk/gdk-api-2.4.raw: 
	* gdk/gdk-api-2.6.raw: Regen

	* generator/Parameters.cs (IsHidden): loosen the definition of
	hideable user_data; it doesn't have to occur at the end of the
	parameter list, as long as there's a callback arg before it.

	* generator/MethodBody.cs (GetCallString): Use Parameters.IsHidden
	to decide whether or not to squash user_data params, rather than
	trying to duplicate its logic. As a side effect, this also causes
	a handful of methods that take non-hidden IntPtr arguments to
	start actually passing those arguments to C rather than always
	passing IntPtr.Zero.

	* generator/Method.cs (Equals, GetHashCode): Remove unnecessary
	and possibly erroneous hashing overrides.

	* gtk/Gtk.metadata: Hide Gtk.Container.ForeachFull, since it's
	useless and wasn't in gtk# 1.0

	* gtk/Menu.custom (Popup):
	* gtk/TextIter.custom (ForwardFindChar, BackwardFindChar):
	* gnome/App.custom (CreateMenusInterp, InsertMenusInterp,
	CreateToolbarInterp):
	* gnome/Client.custom (RequestInteractionInterp):
	* gnome/Popup.custom (MenuDoPopupModal, MenuDoPopup): Add
	[Obsolete] compat overloads for methods that have now lost a
	useless IntPtr.

svn path=/trunk/gtk-sharp/; revision=47566
2005-07-22 19:10:04 +00:00

281 lines
14 KiB
XML

<Type Name="Popup" FullName="Gnome.Popup">
<TypeSignature Language="C#" Value="public class Popup" Maintainer="John Luke" />
<AssemblyInfo>
<AssemblyName>gnome-sharp</AssemblyName>
<AssemblyPublicKey>
</AssemblyPublicKey>
<AssemblyVersion>2.6.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>
<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>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Members>
<Member MemberName="MenuNew">
<MemberSignature Language="C#" Value="public static Gtk.Widget MenuNew (Gnome.UIInfo uiinfo);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>Gtk.Widget</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="uiinfo" Type="Gnome.UIInfo" />
</Parameters>
<Docs>
<summary>Creates a popup menu out of the specified <paramref name="uiinfo" /> array.</summary>
<param name="uiinfo">a <see cref="T:Gnome.UIInfo" /></param>
<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="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);" />
<MemberType>Method</MemberType>
<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);" />
<MemberType>Method</MemberType>
<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="MenuNewWithAccelgroup">
<MemberSignature Language="C#" Value="public static Gtk.Widget MenuNewWithAccelgroup (Gnome.UIInfo uiinfo, Gtk.AccelGroup accelgroup);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>Gtk.Widget</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="uiinfo" Type="Gnome.UIInfo" />
<Parameter Name="accelgroup" Type="Gtk.AccelGroup" />
</Parameters>
<Docs>
<summary>Creates a popup menu out of the specified <paramref name="uiinfo" /> array.</summary>
<param name="uiinfo">a <see cref="T:Gnome.UIInfo" /></param>
<param name="accelgroup">a <see cref="T:Gtk.AccelGroup" /></param>
<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>
<Member MemberName="MenuGetAccelGroup">
<MemberSignature Language="C#" Value="public static Gtk.AccelGroup MenuGetAccelGroup (Gtk.Menu menu);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>Gtk.AccelGroup</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="menu" Type="Gtk.Menu" />
</Parameters>
<Docs>
<summary>This function is used to retrieve the accelgroup that was created by <see cref="M:Gnome.Popup.MenuNew(Gnome.UIInfo)" />.</summary>
<param name="menu">a <see cref="T:Gtk.Menu" /></param>
<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="MenuAppend">
<MemberSignature Language="C#" Value="public static void MenuAppend (Gtk.Widget popup, Gnome.UIInfo uiinfo);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="popup" Type="Gtk.Widget" />
<Parameter Name="uiinfo" Type="Gnome.UIInfo" />
</Parameters>
<Docs>
<summary>Appends the menu items in <paramref name="uiinfo" /> to the <paramref name="popup" /> menu.</summary>
<param name="popup">a <see cref="T:Gtk.Widget" /></param>
<param name="uiinfo">a <see cref="T:Gnome.UIInfo" /></param>
<remarks>
</remarks>
</Docs>
</Member>
<Member MemberName="MenuAttach">
<MemberSignature Language="C#" Value="public static void MenuAttach (Gtk.Widget popup, Gtk.Widget widget, IntPtr user_data);" />
<MemberType>Method</MemberType>
<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>
<summary>Attaches the specified <paramref name="popup" /> menu to the specified <paramref name="widget" />.</summary>
<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>
<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="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);" />
<MemberType>Method</MemberType>
<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=".ctor">
<MemberSignature Language="C#" Value="public Popup ();" />
<MemberType>Constructor</MemberType>
<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="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);" />
<MemberType>Method</MemberType>
<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>
</Members>
</Type>