[Monodevelop-patches-list] r1277 - trunk/MonoDevelop/build/data/templates/project/CSharp
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Sun Mar 28 11:34:08 EST 2004
Author: miguel
Date: 2004-03-28 11:34:08 -0500 (Sun, 28 Mar 2004)
New Revision: 1277
Modified:
trunk/MonoDevelop/build/data/templates/project/CSharp/GladeSharpProject.xpt
Log:
Improve the Glade Project
Modified: trunk/MonoDevelop/build/data/templates/project/CSharp/GladeSharpProject.xpt
===================================================================
--- trunk/MonoDevelop/build/data/templates/project/CSharp/GladeSharpProject.xpt 2004-03-28 08:00:58 UTC (rev 1276)
+++ trunk/MonoDevelop/build/data/templates/project/CSharp/GladeSharpProject.xpt 2004-03-28 16:34:08 UTC (rev 1277)
@@ -5,7 +5,7 @@
<!-- Template Header -->
<TemplateConfiguration>
- <Name>GladeSharp Project</Name>
+ <Name>Glade# Project</Name>
<Category>C#</Category>
<Icon>C#.Project.Form</Icon>
<LanguageName>C#</LanguageName>
@@ -37,7 +37,7 @@
</References>
<Resources>
-<File name="file.glade"><![CDATA[<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<File name="gui.glade"><![CDATA[<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
@@ -55,16 +55,6 @@
<property name="destroy_with_parent">False</property>
<signal name="delete_event" handler="OnWindowDeleteEvent" last_modification_time="${Date} ${Time}"/>
- <child>
- <widget class="GtkButton" id="button1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Hello !</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <signal name="clicked" handler="OnButtonClickedEvent" last_modification_time="${Date} ${Time}"/>
- </widget>
- </child>
</widget>
</glade-interface>
@@ -74,51 +64,33 @@
<Files>
<File name="Main.cs">
<![CDATA[// project created on ${Date} at ${Time}
- using System;
- using Gtk;
- using Glade;
- using GtkSharp;
+using System;
+using Gtk;
+using Glade;
- public class GladeTest
+public class GladeApp
+{
+ public static void Main (string[] args)
{
- public static void Main (string[] args)
- {
- new GladeTest(args);
- }
+ new GladeApp (args);
+ }
- /* If you want to access the glade objects you have to "import" them.
- * This is not required, but else you can only work with the
- * pre-defined signal handlers */
- [Glade.Widget]
- Button button1;
+ public GladeApp (string[] args)
+ {
+ Application.Init();
- public GladeTest (string[] args)
- {
- Application.Init();
+ Glade.XML gxml = new Glade.XML (null, "gui.glade", "window1", null);
+ gxml.Autoconnect (this);
+ Application.Run();
+ }
- /* This loads the glade file glade.glade,
- * selects window1 and connects it to the current object,
- * which is the class GladeTest here. */
- Glade.XML gxml = new Glade.XML (null,"file.glade", "window1", null);
- gxml.Autoconnect (this);
-
- button1.BorderWidth=10;
-
- Application.Run();
- }
-
- /* Connect the Signals defined in Glade */
- public void OnWindowDeleteEvent (object o, DeleteEventArgs args)
- {
- Application.Quit ();
- args.RetVal = true;
- }
-
- public void OnButtonClickedEvent (System.Object obj, EventArgs e)
- {
- Console.WriteLine ("Word !");
- }
+ /* Connect the Signals defined in Glade */
+ public void OnWindowDeleteEvent (object o, DeleteEventArgs args)
+ {
+ Application.Quit ();
+ args.RetVal = true;
}
+}
]]>
</File>
More information about the Monodevelop-patches-list
mailing list