2003-02-12 02:00:12 +00:00
<Type Name= "OptionMenu" FullName= "Gtk.OptionMenu" >
2005-05-23 20:41:51 +00:00
<TypeSignature Language= "C#" Maintainer= "John Luke" Value= "public class OptionMenu : Gtk.Button" />
2003-02-12 02:00:12 +00:00
<AssemblyInfo >
<AssemblyName > gtk-sharp</AssemblyName>
2003-12-24 01:35:30 +00:00
<AssemblyPublicKey >
</AssemblyPublicKey>
2005-09-03 04:11:38 +00:00
<AssemblyVersion > 2.6.0.0</AssemblyVersion>
2003-02-12 02:00:12 +00:00
</AssemblyInfo>
2003-02-23 07:26:30 +00:00
<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>
2003-02-12 02:00:12 +00:00
<Docs >
2003-07-19 23:00:56 +00:00
<summary > A widget used to choose from a list of valid choices.</summary>
<remarks >
2003-09-17 21:56:59 +00:00
<para >
A <see cref= "T:Gtk.OptionMenu" /> is a widget that allows the user to choose from a list of valid choices.
The <see cref= "T:Gtk.OptionMenu" /> displays the selected choice.
When activated the <see cref= "T:Gtk.OptionMenu" /> displays a popup <see cref= "T:Gtk.Menu" /> which allows the user to make a new choice.
2003-07-19 23:00:56 +00:00
</para>
2003-09-17 21:56:59 +00:00
<para >
Using a <see cref= "T:Gtk.OptionMenu" /> is simple; build a <see cref= "T:Gtk.Menu" /> , by calling <see cref= "C:Gtk.Menu()" /> , then appending <see cref= "T:Gtk.MenuItem" /> s to it with <see cref= "M:Gtk.MenuShell.Append()" /> .
Set that menu on the <see cref= "T:Gtk.OptionMenu" /> with <see cref= "P:Gtk.OptionMenu.Menu" /> .
Set the selected <see cref= "T:Gtk.MenuItem" /> with <see cref= "M:Gtk.OptionMenu.SetHistory(System.UInt32)" /> ; connect to the event <see cref= "E:Gtk.OptionMenu.Changed" /> ; when the <see cref= "E:Gtk.OptionMenu.Changed" /> event occurs, check the new selected <see cref= "T:Gtk.MenuItem" /> with <see cref= "P:Gtk.OptionMenu.History" /> .
2003-07-19 23:00:56 +00:00
</para>
2003-09-17 21:56:59 +00:00
</remarks>
<example >
<code language= "C#" >
2003-07-19 23:00:56 +00:00
using System;
using Gtk;
class OptionMenuSample
{
OptionMenu opt;
static void Main ()
{
new OptionMenuSample ();
}
OptionMenuSample ()
{
Application.Init ();
Window win = new Window ("OptionMenuSample");
win.DeleteEvent += new DeleteEventHandler (OnWinDelete);
// set up the OptionMenu
opt = new OptionMenu ();
opt.Changed += new EventHandler (OnOptionChanged);
Menu m = new Menu ();
MenuItem miOne = new MenuItem ("One");
m.Append (miOne);
MenuItem miTwo = new MenuItem ("Two");
m.Append (miTwo);
MenuItem miThree = new MenuItem ("Three");
m.Append (miThree);
// add children widgets to their parents
opt.Menu = m;
win.Add (opt);
// set the OptionMenu to a value
opt.SetHistory (2);
win.ShowAll ();
Application.Run ();
}
void OnOptionChanged (object o, EventArgs args)
{
Console.WriteLine (opt.History);
}
void OnWinDelete (object o, DeleteEventArgs args)
{
Application.Quit ();
}
}
</code>
2003-09-17 21:56:59 +00:00
</example>
2003-02-12 02:00:12 +00:00
</Docs>
<Base >
<BaseTypeName > Gtk.Button</BaseTypeName>
</Base>
<Interfaces >
</Interfaces>
2005-05-23 20:41:51 +00:00
<Attributes >
<Attribute >
<AttributeName > System.Obsolete(Message=null, IsError=False)</AttributeName>
</Attribute>
</Attributes>
2003-02-12 02:00:12 +00:00
<Members >
<Member MemberName= "RemoveMenu" >
<MemberSignature Language= "C#" Value= "public void RemoveMenu ();" />
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs >
2003-09-17 21:56:59 +00:00
<summary > Removes the menu from the <see cref= "T:Gtk.OptionMenu" /> .</summary>
2003-07-19 23:00:56 +00:00
<remarks />
2003-02-12 02:00:12 +00:00
</Docs>
</Member>
<Member MemberName= ".ctor" >
<MemberSignature Language= "C#" Value= "public OptionMenu (IntPtr raw);" />
<MemberType > Constructor</MemberType>
<ReturnValue />
<Parameters >
2003-09-17 21:56:59 +00:00
<Parameter Name= "raw" Type= "System.IntPtr" />
</Parameters>
2003-02-12 02:00:12 +00:00
<Docs >
2003-02-23 07:26:30 +00:00
<summary > Internal constructor</summary>
<param name= "raw" > Pointer to the C object.</param>
<remarks >
<para > This is an internal constructor, and should not be used by user code.</para>
</remarks>
2003-02-12 02:00:12 +00:00
</Docs>
</Member>
<Member MemberName= ".ctor" >
<MemberSignature Language= "C#" Value= "public OptionMenu ();" />
<MemberType > Constructor</MemberType>
<ReturnValue />
<Parameters />
<Docs >
2003-09-17 21:56:59 +00:00
<summary > Creates a new <see cref= "T:Gtk.OptionMenu" /> </summary>
<remarks > This is the default constructor for <see cref= "T:Gtk.OptionMenu" /> </remarks>
2003-02-12 02:00:12 +00:00
</Docs>
</Member>
<Member MemberName= "History" >
<MemberSignature Language= "C#" Value= "public int History { get; };" />
<MemberType > Property</MemberType>
<ReturnValue >
<ReturnType > System.Int32</ReturnType>
</ReturnValue>
<Docs >
2003-09-17 21:56:59 +00:00
<summary > Retrieves the index of the currently selected <see cref= "T:Gtk.MenuItem" /> .</summary>
2005-05-23 20:41:51 +00:00
<value > an object of type <see cref= "T:System.Int32" /> </value>
2003-09-17 21:56:59 +00:00
<remarks > The <see cref= "T:Gtk.MenuItem" /> s are numbered from top to bottom, starting with 0.</remarks>
2003-02-12 02:00:12 +00:00
</Docs>
</Member>
<Member MemberName= "Menu" >
<MemberSignature Language= "C#" Value= "public Gtk.Widget Menu { set; get; };" />
<MemberType > Property</MemberType>
<ReturnValue >
<ReturnType > Gtk.Widget</ReturnType>
</ReturnValue>
2003-12-24 01:35:30 +00:00
<Parameters >
</Parameters>
2003-02-12 02:00:12 +00:00
<Docs >
2003-07-19 23:00:56 +00:00
<summary > The menu of options.</summary>
2005-05-23 20:41:51 +00:00
<value > an object of type <see cref= "T:Gtk.Widget" /> </value>
2003-07-19 23:00:56 +00:00
<remarks />
2003-02-12 02:00:12 +00:00
</Docs>
2005-08-23 17:02:47 +00:00
<Attributes >
2005-05-23 20:41:51 +00:00
<Attribute >
<AttributeName > GLib.Property(Name="menu")</AttributeName>
</Attribute>
2005-08-23 17:02:47 +00:00
</Attributes>
</Member>
2003-02-12 02:00:12 +00:00
<Member MemberName= "Changed" >
<MemberSignature Language= "C#" Value= "public event EventHandler Changed;" />
<MemberType > Event</MemberType>
2003-09-17 21:56:59 +00:00
<ReturnValue >
<ReturnType > System.EventHandler</ReturnType>
</ReturnValue>
2003-02-12 02:00:12 +00:00
<Parameters />
<Docs >
2003-09-17 21:56:59 +00:00
<summary > Emitted when the <see cref= "T:Gtk.OptionMenu" /> selection is changed.</summary>
2003-07-19 23:00:56 +00:00
<remarks />
2003-02-12 02:00:12 +00:00
</Docs>
2005-08-23 17:02:47 +00:00
<Attributes >
2005-05-23 20:41:51 +00:00
<Attribute >
<AttributeName > GLib.Signal(CName="changed")</AttributeName>
</Attribute>
2005-08-23 17:02:47 +00:00
</Attributes>
</Member>
2003-07-17 06:38:40 +00:00
<Member MemberName= "SetHistory" >
<MemberSignature Language= "C#" Value= "public void SetHistory (uint index_);" />
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > System.Void</ReturnType>
</ReturnValue>
<Parameters >
2003-09-17 21:56:59 +00:00
<Parameter Name= "index_" Type= "System.UInt32" />
</Parameters>
2003-07-17 06:38:40 +00:00
<Docs >
2003-09-17 21:56:59 +00:00
<summary > Selects the menu item specified by <paramref name= "index_" /> making it the newly selected value for the <see cref= "T:Gtk.OptionMenu" /> .</summary>
2003-07-17 06:38:40 +00:00
<param name= "index_" > a <see cref= "T:System.UInt32" /> </param>
2003-07-19 23:00:56 +00:00
<remarks />
2003-07-17 06:38:40 +00:00
</Docs>
</Member>
2003-12-24 01:35:30 +00:00
<Member MemberName= "GType" >
<MemberSignature Language= "C#" Value= "public static GLib.GType GType { get; };" />
<MemberType > Property</MemberType>
<ReturnValue >
<ReturnType > GLib.GType</ReturnType>
</ReturnValue>
<Parameters />
<Docs >
2004-06-21 20:14:42 +00:00
<summary > GType Property.</summary>
2005-05-23 20:41:51 +00:00
<value > a <see cref= "T:GLib.GType" /> </value>
2004-06-21 20:14:42 +00:00
<remarks > Returns the native <see cref= "T:GLib.GType" /> value for <see cref= "T:Gtk.OptionMenu" /> .</remarks>
2003-12-24 01:35:30 +00:00
</Docs>
</Member>
<Member MemberName= "OnChanged" >
<MemberSignature Language= "C#" Value= "protected virtual void OnChanged ();" />
<MemberType > Method</MemberType>
<ReturnValue >
<ReturnType > System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs >
2004-06-15 15:41:25 +00:00
<summary > Default handler for the <see cref= "M:Gtk.OptionMenu.Changed" /> event.</summary>
<remarks > Override this method in a subclass to provide a default handler for the <see cref= "M:Gtk.OptionMenu.Changed" /> event.</remarks>
2003-12-24 01:35:30 +00:00
</Docs>
</Member>
<Member MemberName= ".ctor" >
<MemberSignature Language= "C#" Value= "protected OptionMenu (GLib.GType gtype);" />
<MemberType > Constructor</MemberType>
<ReturnValue />
<Parameters >
<Parameter Name= "gtype" Type= "GLib.GType" />
</Parameters>
<Docs >
2004-06-21 20:33:11 +00:00
<summary > Protected Constructor.</summary>
2003-12-24 01:35:30 +00:00
<param name= "gtype" > a <see cref= "T:GLib.GType" /> </param>
2004-06-21 20:33:11 +00:00
<remarks > Chain to this constructor if you have manually registered a native <see cref= "T:GLib.GType" /> value for your subclass.</remarks>
2003-12-24 01:35:30 +00:00
</Docs>
2005-08-23 17:02:47 +00:00
<Attributes >
2005-05-23 20:41:51 +00:00
<Attribute >
<AttributeName > System.Obsolete(Message=null, IsError=False)</AttributeName>
</Attribute>
2005-08-23 17:02:47 +00:00
</Attributes>
</Member>
2003-02-12 02:00:12 +00:00
</Members>
2005-05-23 20:41:51 +00:00
</Type>