2003-07-22 John Luke <jluke@cfl.rr.com>

* en/Gtk/Menu.xml: add example

svn path=/trunk/gtk-sharp/; revision=16553
This commit is contained in:
John Luke 2003-07-23 01:10:29 +00:00
parent 75d8f2a98b
commit a0ee3f3b89
2 changed files with 52 additions and 3 deletions

View File

@ -3,6 +3,7 @@
* en/Rsvg: add directory
* en/Rsvg/*.xml: add initial docs
* en/Rsvg/Tool.xml: add example
* en/Gtk/Menu.xml: add example
2003-07-22 Duncan Mak <duncan@ximian.com>

View File

@ -7,7 +7,7 @@
</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>A GtkMenu is a GtkMenuShell that implements a drop down menu.</summary>
<summary>A <see cref="T:Gtk.Menu" /> is a <see cref="T:Gtk.MenuShell" /> that implements a drop down menu.</summary>
<remarks>
<para>
A <see cref="T:Gtk.Menu" /> is a <see cref="T:Gtk.MenuShell" /> that implements a drop down menu consisting of a list of <see cref="T:Gtk.MenuItem" /> objects which can be navigated and activated by the user to perform application functions.
@ -16,6 +16,54 @@
It is commonly dropped down by activating a <see cref="T:Gtk.MenuItem" /> in a <see cref="T:Gtk.MenuBar" /> or in another <see cref="T:Gtk.Menu" />, it can also be popped up by activating a <see cref="T:Gtk.OptionMenu" />. Other composite widgets such as the <see cref="T:Gtk.Notebook" /> can pop up a <see cref="T:Gtk.Menu" /> as well.
</para>
</remarks>
<example>
<code language="C#">
using System;
using Gtk;
using GtkSharp;
public class MenuApp {
public static void Main (string[] args)
{
Application.Init();
Window win = new Window ("Menu Sample App");
win.DeleteEvent += new DeleteEventHandler (delete_cb);
win.SetDefaultSize (200, 150);
VBox box = new VBox (false, 2);
MenuBar mb = new MenuBar ();
Menu file_menu = new Menu ();
MenuItem exit_item = new MenuItem("Exit");
exit_item.Activated += new EventHandler (exit_cb);
file_menu.Append (exit_item);
MenuItem file_item = new MenuItem("File");
file_item.Submenu = file_menu;
mb.Append (file_item);
box.PackStart(mb, false, false, 0);
Button btn = new Button ("Yep, that's a menu");
box.PackStart(btn, true, true, 0);
win.Add (box);
win.ShowAll ();
Application.Run ();
}
static void delete_cb (object o, DeleteEventArgs args)
{
Application.Quit ();
}
static void exit_cb (object o, EventArgs args)
{
Application.Quit ();
}
}
</code>
<example>
</Docs>
<Base>
<BaseTypeName>Gtk.MenuShell</BaseTypeName>
@ -314,8 +362,8 @@
</Parameters>
<Docs>
<summary>To be added</summary>
<param name="value">To be added: an object of type 'string'</param>
<returns>To be added: an object of type 'string'</returns>
<param name="value">an object of type <see cref="T:System.String"/></param>
<returns>an object of type <see cref="T:System.String"/></returns>
<remarks>To be added</remarks>
</Docs>
</Member>