[Gtk-sharp-list] [Patch] gnome/Program.custom
Charles Iliya Krempeaux
charles@reptile.ca
14 Mar 2003 12:44:45 -0800
--=-ExioDZ4dscwpMWtTnDUy
Content-Type: multipart/alternative; boundary="=-EbsTivPbbB/NCEAUgLuK"
--=-EbsTivPbbB/NCEAUgLuK
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
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.)
See ya
--
Charles Iliya Krempeaux, BSc
charles@reptile.ca
________________________________________________________________________
Reptile Consulting & Services 604-REPTILE http://www.reptile.ca/
--=-EbsTivPbbB/NCEAUgLuK
Content-Type: text/html; charset=utf-8
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/1.1.8">
</HEAD>
<BODY>
Hello,<BR>
<BR>
Can I commit this Patch.<BR>
<BR>
This Patch makes it so you can write code like this:<BR>
<BR>
<FONT SIZE="2"><TT> class HelloWorld<BR>
{<BR>
static void Main(string[] args)<BR>
{<BR>
Gnome.Program program =<BR>
new Gnome.Program("Hello World", "1.0", Gnome.Modules.UI, args);<BR>
<BR>
Gnome.App app = new Gnome.App("Hello World", "Hello World");<BR>
<BR>
program.Run(app);<BR>
}<BR>
}</TT></FONT><BR>
<BR>
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 <TT>DeleteEvent</TT> event to a method or procedure that quits the program. And don't have to do a <TT>ShowAll()</TT>. (This is a WinForms style thing.)<BR>
<BR>
<BR>
See ya<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>--
Charles Iliya Krempeaux, BSc
charles@reptile.ca
________________________________________________________________________
Reptile Consulting & Services 604-REPTILE http://www.reptile.ca/</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
--=-EbsTivPbbB/NCEAUgLuK--
--=-ExioDZ4dscwpMWtTnDUy
Content-Disposition: attachment; filename=gtk-sharp-New_Gnome.App.Run-Procedure.diff
Content-Transfer-Encoding: quoted-printable
Content-Type: text/x-patch; name=gtk-sharp-New_Gnome.App.Run-Procedure.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:41:58 -0000
@@ -1,3 +1,14 @@
+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.
+ * sample/GnomeHelloWorld.cs : Changed this program
+ to use the Run() method made above.
+
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:42:02 -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 ();
--=-ExioDZ4dscwpMWtTnDUy--