diff --git a/ChangeLog b/ChangeLog index 2d6a24432..c89a7362a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-05-02 Mike Kestner + + * generator/ObjectGen.cs : Add support for .custom files. + * gtk/Window.custom : clean up build + * sample/HelloWorld.cs : Use the customizations. + * sample/ButtonApp.cs : Use the customizations. + 2002-05-02 Mike Kestner * README : Describe the new make procedure. diff --git a/generator/ObjectGen.cs b/generator/ObjectGen.cs index 9225e95f9..105834250 100644 --- a/generator/ObjectGen.cs +++ b/generator/ObjectGen.cs @@ -145,6 +145,14 @@ namespace GtkSharp.Generation { } } + string custom = ".." + sep + ns.ToLower() + sep + Name + ".custom"; + if (File.Exists(custom)) { + FileStream custstream = new FileStream (custom, FileMode.Open, FileAccess.Read); + StreamReader sr = new StreamReader (custstream); + sw.WriteLine (sr.ReadToEnd ()); + sr.Close (); + } + sw.WriteLine ("\t}"); sw.WriteLine (); sw.WriteLine ("}"); diff --git a/gtk/Window.custom b/gtk/Window.custom index 5bdb65649..fd63f9ee5 100755 --- a/gtk/Window.custom +++ b/gtk/Window.custom @@ -7,19 +7,6 @@ // This code is inserted after the automatically generated code. - /// - /// Window Constructor - /// - /// - /// - /// Constructs a new Window of type TopLevel. - /// - - public Window () - { - RawObject = gtk_window_new ((int)WindowType.Toplevel); - } - /// /// Window Constructor /// @@ -29,7 +16,7 @@ /// specified Title. /// - public Window (String title) : this () + public Window (String title) : this (WindowType.Toplevel) { this.Title = title; } diff --git a/sample/ButtonApp.cs b/sample/ButtonApp.cs index 0f4c2f930..1e1afb078 100755 --- a/sample/ButtonApp.cs +++ b/sample/ButtonApp.cs @@ -9,16 +9,15 @@ namespace GtkSamples { using Gtk; using GtkSharp; using System; + using System.Drawing; public class ButtonApp { public static int Main (string[] args) { Application.Init (); - Window win = new Window (WindowType.Toplevel); - win.Title = "Button Tester"; - win.DefaultHeight = 120; - win.DefaultWidth = 160; + Window win = new Window ("Button Tester"); + win.DefaultSize = new Size (200, 150); win.DeleteEvent += new EventHandler (Window_Delete); Button btn = new Button ("Click Me"); btn.Clicked += new EventHandler (btn_click); diff --git a/sample/HelloWorld.cs b/sample/HelloWorld.cs index 5e7e01d1e..847039a6f 100755 --- a/sample/HelloWorld.cs +++ b/sample/HelloWorld.cs @@ -10,15 +10,13 @@ namespace GtkSamples { using Gdk; using GtkSharp; using System; - using System.Drawing; public class HelloWorld { public static int Main (string[] args) { Application.Init (); - Gtk.Window win = new Gtk.Window (Gtk.WindowType.Toplevel); - win.Title = "Gtk# Hello World"; + Gtk.Window win = new Gtk.Window ("Gtk# Hello World"); win.DeleteEvent += new EventHandler (Window_Delete); win.ShowAll (); Application.Run ();