[Gtk-sharp-list] EventBox doc

John Luke jluke@cfl.rr.com
02 May 2003 01:28:24 -0400


--=-ZZeP4TbXHc3ixNQ5xlrp
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hello,

Here is a first draft for gtk-sharp/doc/en/Gtk/EventBox.xml
Can someone commit if it is OK?

Thanks,
John Luke

--=-ZZeP4TbXHc3ixNQ5xlrp
Content-Disposition: attachment; filename=EventBox.diff
Content-Type: text/x-patch; name=EventBox.diff; charset=UTF-8
Content-Transfer-Encoding: 7bit

Index: EventBox.xml
===================================================================
RCS file: /mono/gtk-sharp/doc/en/Gtk/EventBox.xml,v
retrieving revision 1.5
diff -u -r1.5 EventBox.xml
--- EventBox.xml	8 Mar 2003 06:28:12 -0000	1.5
+++ EventBox.xml	2 May 2003 05:30:35 -0000
@@ -7,8 +7,64 @@
   </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>To be added</summary>
-    <remarks>To be added</remarks>
+    <summary>A widget used to catch events for widgets which do not have their own window.</summary>
+    <remarks>The <see cref="T:Gtk.EventBox"/> widget is a subclass of <see cref="T:Gtk.Bin"/> which also has its own window. It is useful since it allows you to catch events for widgets which do not have their own window.
+			<para><example>
+				<code lang="C#">
+using Gtk;
+using GtkSharp;
+using Gdk;
+using System;
+
+
+public class eventbox
+{
+
+	static void delete_event (object obj, DeleteEventArgs args)
+	{
+		Application.Quit();
+	}
+
+	static void exitbutton_event (object obj, ButtonPressEventArgs args)
+	{
+		Application.Quit();
+	}
+
+	public static void Main (string[] args)
+	{
+		Gtk.Window window;
+		EventBox eventbox;
+		Label label;
+
+		Application.Init();
+
+		window = new Gtk.Window ("Eventbox");
+		window.DeleteEvent += new DeleteEventHandler (delete_event);
+
+		window.BorderWidth = 10;
+
+		eventbox = new EventBox ();
+		window.Add (eventbox);
+		eventbox.Show();
+
+		label = new Label ("Click here to quit");
+		eventbox.Add(label);
+		label.Show();
+
+		label.SetSizeRequest(110, 20);
+
+		eventbox.ButtonPressEvent += new ButtonPressEventHandler (exitbutton_event);
+
+		eventbox.Realize();
+
+		window.Show();
+			
+		Application.Run();
+	}
+}
+				</code>
+			</example></para>
+		</remarks>
   </Docs>
   <Base>
     <BaseTypeName>Gtk.Bin</BaseTypeName>
@@ -63,9 +119,13 @@
       <ReturnValue />
       <Parameters />
       <Docs>
-        <summary>To be added</summary>
-        <returns>To be added: an object of type 'Gtk.EventBox'</returns>
-        <remarks>To be added</remarks>
+        <summary>Creates a new <see cref="T:Gtk.EventBox"/>.</summary>
+        <returns>an object of type <see cref="T:Gtk.EventBox"/></returns>
+        <remarks>Creates a new <see cref="T:Gtk.EventBox"/>.
+					<example>
+						<code lang="C#">EventBox eb = new EventBox();</code>
+					</example>
+				</remarks>
       </Docs>
     </Member>
     <Member MemberName="GType">
@@ -75,8 +135,8 @@
         <ReturnType>System.UInt32</ReturnType>
       </ReturnValue>
       <Docs>
-        <summary>The GLib Type for Gtk.EventBox</summary>
-        <returns>The GLib Type for the Gtk.EventBox class.</returns>
+        <summary>The <see cref="T:GLib.Type"/> for <see cref="T:Gtk.EventBox"/></summary>
+        <returns>The <see cref="T:GLib.Type"/> for the <see cref="T:Gtk.EventBox"/> class.</returns>
         <remarks />
       </Docs>
     </Member>
@@ -90,11 +150,11 @@
       <Docs>
         <summary>Internal constructor</summary>
         <param name="gtype">GLib type for the type</param>
-        <returns>Creates a new instance of EventBox, using the GLib-provided type</returns>
+        <returns>Creates a new instance of <see cref="T:Gtk.EventBox"/>, using the GLib-provided type</returns>
         <remarks>
           <para>This is a constructor used by derivative types of <see cref="T:Gtk.EventBox" /> that would have their own GLib type assigned to it.  This is not typically used by C# code.</para>
         </remarks>
       </Docs>
     </Member>
   </Members>
-</Type>
\ No newline at end of file
+</Type>

--=-ZZeP4TbXHc3ixNQ5xlrp--