Hi. 

I noticed that gtk-monodoc doesn't end when you push the close window
button (the X in the top right corner).  I braved the wilds of GTK#
programming and added the event to make it do so. 

Of course, although it works, I'm not sure I did it the best way.  Since
there is already a OnQuitActivate for the menu, I thought there should
be some way to reuse that method, but since the signature is different,
it doesn't work for the Window_Delete event. 

Anyway, please let me know if there's a better way to do this, or
otherwise if I can commit my first gui patch. 

Regards 
Nick D.


Index: main.cs
===================================================================
RCS file: /cvs/public/monodoc/doctools/gtk-monodoc/main.cs,v
retrieving revision 1.15
diff -u -r1.15 main.cs
--- main.cs	4 Nov 2002 02:32:12 -0000	1.15
+++ main.cs	6 Nov 2002 13:26:24 -0000
@@ -67,6 +67,14 @@
 	// last edit
 	Item last_edit = Item.Empty;
 	XmlNode last_node = null;
+
+	void Window_Delete (object obj, DeleteEventArgs args)
+	{
+		SignalArgs sa = (SignalArgs) args;
+		Application.Quit ();
+		sa.RetVal = true;	
+	}
+
 	
 	DocumentationEditor (string [] args)
 	{
@@ -74,6 +82,8 @@
 		gxml = new Glade.XML (null, "gtk-monodoc.glade", null, null);
 
 		LoadWidgetPointers ();
+
+		main_window.DeleteEvent += new DeleteEventHandler (Window_Delete);
 
 		//
 		// Customize the TreeView

Reply via email to