[Gtk-sharp-list] [Patch] gnome/Program.custom

Charles Iliya Krempeaux charles@reptile.ca
14 Mar 2003 12:54:04 -0800


--=-j9yc7+BE0kqNW9XDaUtj
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hello,

Sorry, there was an error in the ChangeLog.  Here's a new Patch.


See ya

On Fri, 2003-03-14 at 12:44, Charles Iliya Krempeaux wrote:
> Hello,
> 
> Can I commit this Patch.
> 
> This Patch makes it so you can write code like this:
> 
>     class HelloWorld
>     {
>             static void Main(string[] args)
>             {
>                     Gnome.Program program =
>                     new Gnome.Program("Hello World", "1.0",
> Gnome.Modules.UI, args);
> 
>                     Gnome.App app = new Gnome.App("Hello World",
> "Hello World");
> 
>                     program.Run(app);
>             }
>     }
> 
> Basically, it makes it so, if you want to write a simple Gnome
> application, you don't have to do through all the complexities of
> connecting Gnome.App's DeleteEvent event to a method or procedure that
> quits the program.  And don't have to do a ShowAll().  (This is a
> WinForms style thing.)


-- 
     Charles Iliya Krempeaux, BSc
     charles@reptile.ca

________________________________________________________________________
 Reptile Consulting & Services    604-REPTILE    http://www.reptile.ca/

--=-j9yc7+BE0kqNW9XDaUtj
Content-Disposition: attachment; filename=gtk-sharp-New_Gnome.App.Run-Procedure-Version-2.diff
Content-Transfer-Encoding: quoted-printable
Content-Type: text/x-patch; name=gtk-sharp-New_Gnome.App.Run-Procedure-Version-2.diff; charset=ISO-8859-1

Index: ChangeLog
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/ChangeLog,v
retrieving revision 1.354
diff -u -r1.354 ChangeLog
--- ChangeLog	14 Mar 2003 11:45:18 -0000	1.354
+++ ChangeLog	14 Mar 2003 20:51:14 -0000
@@ -1,3 +1,12 @@
+2003-03-14  Charles Iliya Krempeaux  <charles@reptile.ca>
+
+	* gnome/Program.custom : Added a WinForms style
+	  Run() procedure.  (This Run() procedure take
+	  Gnome.App as a parameter, and takes care of all
+	  the dirty work of calling the ShowAll() method
+	  and connecting the event DeleteEvent to a method
+	  that will close the program.)
+
 2003-03-14  Rodrigo Moya <rodrigo@ximian.com>
=20
 	* configure.in:
Index: gnome/Program.custom
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/gnome/Program.custom,v
retrieving revision 1.5
diff -u -r1.5 Program.custom
--- gnome/Program.custom	15 Oct 2002 21:46:33 -0000	1.5
+++ gnome/Program.custom	14 Mar 2003 20:51:15 -0000
@@ -70,6 +70,20 @@
 	Gtk.Application.Run ();
 }
=20
+public void Run(Gnome.App app)
+{
+        app.DeleteEvent +=3D new GtkSharp.DeleteEventHandler(this.Quit);
+
+        app.ShowAll();
+
+        this.Run();
+}
+
+private void Quit(object obj, GtkSharp.DeleteEventArgs args)
+{
+        this.Quit();
+}
+
 public void Quit ()
 {
 	Gtk.Application.Quit ();

--=-j9yc7+BE0kqNW9XDaUtj--