<Type Name="OptionMenu" FullName="Gtk.OptionMenu">
  <TypeSignature Language="C#" Maintainer="John Luke" Value="public class OptionMenu : Gtk.Button" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit OptionMenu extends Gtk.Button" />
  <AssemblyInfo>
    <AssemblyName>gtk-sharp</AssemblyName>
    <AssemblyPublicKey>
    </AssemblyPublicKey>
    <AssemblyVersion>2.12.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>Gtk.Button</BaseTypeName>
  </Base>
  <Interfaces>
  </Interfaces>
  <Attributes>
    <Attribute>
      <AttributeName>System.Obsolete</AttributeName>
    </Attribute>
  </Attributes>
  <Docs>
    <summary>A widget used to choose from a list of valid choices.</summary>
    <remarks>
      <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.    
	  </para>
      <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" />.
	  </para>
    </remarks>
    <example>
      <code language="C#">
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>
    </example>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public OptionMenu ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.12.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue />
      <Parameters />
      <Docs>
        <summary>Creates a new <see cref="T:Gtk.OptionMenu" /></summary>
        <remarks>This is the default constructor for <see cref="T:Gtk.OptionMenu" /></remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="protected OptionMenu (GLib.GType gtype);" />
      <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(valuetype GLib.GType gtype) cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.12.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>System.Obsolete</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue />
      <Parameters>
        <Parameter Name="gtype" Type="GLib.GType" />
      </Parameters>
      <Docs>
        <param name="gtype">a <see cref="T:GLib.GType" /></param>
        <summary>Protected Constructor.</summary>
        <remarks>Chain to this constructor if you have manually registered a native <see cref="T:GLib.GType" /> value for your subclass.</remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public OptionMenu (IntPtr raw);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(native int raw) cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.12.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue />
      <Parameters>
        <Parameter Name="raw" Type="System.IntPtr" />
      </Parameters>
      <Docs>
        <param name="raw">Pointer to the C object.</param>
        <summary>Internal constructor</summary>
        <remarks>
          <para>This is an internal constructor, and should not be used by user code.</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="Changed">
      <MemberSignature Language="C#" Value="public event EventHandler Changed;" />
      <MemberSignature Language="ILAsm" Value=".event class System.EventHandler Changed" />
      <MemberType>Event</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.12.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>GLib.Signal("changed")</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>System.EventHandler</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Emitted when the <see cref="T:Gtk.OptionMenu" /> selection is changed.</summary>
        <remarks />
      </Docs>
    </Member>
    <Member MemberName="GType">
      <MemberSignature Language="C#" Value="public static GLib.GType GType { get; }" />
      <MemberSignature Language="ILAsm" Value=".property valuetype GLib.GType GType" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.12.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>GLib.GType</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>GType Property.</summary>
        <value>a <see cref="T:GLib.GType" /></value>
        <remarks>Returns the native <see cref="T:GLib.GType" /> value for <see cref="T:Gtk.OptionMenu" />.</remarks>
      </Docs>
    </Member>
    <Member MemberName="History">
      <MemberSignature Language="C#" Value="public int History { get; }" />
      <MemberSignature Language="ILAsm" Value=".property instance int32 History" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.12.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Int32</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>Retrieves the index of the currently selected <see cref="T:Gtk.MenuItem" />.</summary>
        <value>an object of type <see cref="T:System.Int32" /></value>
        <remarks>The <see cref="T:Gtk.MenuItem" />s are numbered from top to bottom, starting with 0.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Menu">
      <MemberSignature Language="C#" Value="public Gtk.Widget Menu { get; set; }" />
      <MemberSignature Language="ILAsm" Value=".property instance class Gtk.Widget Menu" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.12.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>GLib.Property("menu")</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>Gtk.Widget</ReturnType>
      </ReturnValue>
      <Parameters>
      </Parameters>
      <Docs>
        <summary>The menu of options.</summary>
        <value>an object of type <see cref="T:Gtk.Widget" /></value>
        <remarks />
      </Docs>
    </Member>
    <Member MemberName="OnChanged">
      <MemberSignature Language="C#" Value="protected virtual void OnChanged ();" />
      <MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnChanged() cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.12.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Attributes>
        <Attribute>
          <AttributeName>GLib.DefaultSignalHandler(ConnectionMethod="OverrideChanged", Type=typeof(Gtk.OptionMenu))</AttributeName>
        </Attribute>
      </Attributes>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <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>
      </Docs>
    </Member>
    <Member MemberName="RemoveMenu">
      <MemberSignature Language="C#" Value="public void RemoveMenu ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void RemoveMenu() cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.12.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Removes the menu from the <see cref="T:Gtk.OptionMenu" />.</summary>
        <remarks />
      </Docs>
    </Member>
    <Member MemberName="SetHistory">
      <MemberSignature Language="C#" Value="public void SetHistory (uint index_);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetHistory(unsigned int32 index_) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.12.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="index_" Type="System.UInt32" />
      </Parameters>
      <Docs>
        <param name="index_">a <see cref="T:System.UInt32" /></param>
        <summary>Selects the menu item specified by <paramref name="index_" /> making it the newly selected value for the <see cref="T:Gtk.OptionMenu" />.</summary>
        <remarks />
      </Docs>
    </Member>
  </Members>
</Type>
