diff --git a/doc/ChangeLog b/doc/ChangeLog index 1ae0d4d2b..710d9fd9e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -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 diff --git a/doc/en/Gtk/Menu.xml b/doc/en/Gtk/Menu.xml index 66078e033..f5c7615bf 100644 --- a/doc/en/Gtk/Menu.xml +++ b/doc/en/Gtk/Menu.xml @@ -7,7 +7,7 @@ Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - A GtkMenu is a GtkMenuShell that implements a drop down menu. + A is a that implements a drop down menu. A is a that implements a drop down menu consisting of a list of 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 in a or in another , it can also be popped up by activating a . Other composite widgets such as the can pop up a as well. + + +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 (); + } +} + + Gtk.MenuShell @@ -314,8 +362,8 @@ To be added - To be added: an object of type 'string' - To be added: an object of type 'string' + an object of type + an object of type To be added