diff --git a/ChangeLog b/ChangeLog index 33f828556..43e6e68a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2003-03-15 Miguel de Icaza + + * sample: Update samples to new Glade.Widget. + + * glade/WidgetAttribute.cs: Moved the old GladeWidgetattribute + here. Now its called `Glade.WidgetAttribute'. + + * glade/GladeWidgetAttribute.cs: Removed + + * glib/Idle.cs: Do not allow Idle class to be instantiated. + 2003-03-11 Miguel de Icaza * gtk/Application.cs (CurrentEvent): Property implementing the diff --git a/glade/GladeWidgetAttribute.cs b/glade/WidgetAttribute.cs similarity index 73% rename from glade/GladeWidgetAttribute.cs rename to glade/WidgetAttribute.cs index 2cffbc107..aa3792c86 100644 --- a/glade/GladeWidgetAttribute.cs +++ b/glade/WidgetAttribute.cs @@ -1,4 +1,4 @@ -// GladeWidgetAttribute.cs +// WidgetAttribute.cs // // Author: Rachel Hestilow // @@ -8,18 +8,18 @@ namespace Glade { using System; [AttributeUsage (AttributeTargets.Field)] - public class GladeWidgetAttribute : Attribute + public class WidgetAttribute : Attribute { private string name; private bool specified; - public GladeWidgetAttribute (string name) + public WidgetAttribute (string name) { specified = true; this.name = name; } - public GladeWidgetAttribute () + public WidgetAttribute () { specified = false; } diff --git a/glade/XML.custom b/glade/XML.custom index 23675e925..e9ed4ac21 100644 --- a/glade/XML.custom +++ b/glade/XML.custom @@ -268,12 +268,12 @@ foreach (System.Reflection.FieldInfo field in fields) { - object[] attrs = field.GetCustomAttributes (typeof (GladeWidgetAttribute), true); + object[] attrs = field.GetCustomAttributes (typeof (WidgetAttribute), true); if (attrs == null || attrs.Length == 0) continue; // The widget to field binding must be 1:1, so only check // the first attribute. - GladeWidgetAttribute widget = (GladeWidgetAttribute) attrs[0]; + WidgetAttribute widget = (WidgetAttribute) attrs[0]; if (widget.Specified) field.SetValue (target, GetWidget (widget.Name), flags, null, null); else field.SetValue (target, GetWidget (field.Name), flags, null, null); } diff --git a/glib/Idle.cs b/glib/Idle.cs index cf764715f..2747b908f 100755 --- a/glib/Idle.cs +++ b/glib/Idle.cs @@ -33,6 +33,10 @@ namespace GLib { public class Idle { + private Idle () + { + } + [DllImport("libglib-2.0-0.dll")] static extern uint g_idle_add (IdleHandler d, IntPtr data); diff --git a/sample/DbClient/client.cs b/sample/DbClient/client.cs index 40dd449b4..c57edd316 100644 --- a/sample/DbClient/client.cs +++ b/sample/DbClient/client.cs @@ -165,7 +165,7 @@ class Client { t.Attach (label, 2, 3, 0, 1); } - static void Db_Insert (Gtk.Object o) + static void Db_Insert () { if (dialog != null) { return; @@ -384,17 +384,17 @@ class Client { static void Insert_Activated (object o, EventArgs args) { - Db_Insert (o as Gtk.Object); + Db_Insert (); } static void Remove_Activated (object o, EventArgs args) { - Db_Remove (o as Gtk.Object); + Db_Remove (); } static void Update_Activated (object o, EventArgs args) { - Db_Update (o as Gtk.Object); + Db_Update (); } static void Quit_Activated (object o, EventArgs args) diff --git a/sample/GladeTest.cs b/sample/GladeTest.cs index 5aaf5f94e..b925a7c3e 100644 --- a/sample/GladeTest.cs +++ b/sample/GladeTest.cs @@ -16,7 +16,7 @@ namespace GladeSamples { public class GladeTest : Program { - [GladeWidget("main_window")] + [Glade.Widget("main_window")] Gtk.Window main_window; public static void Main (string[] args) @@ -34,7 +34,7 @@ namespace GladeSamples { if (main_window != null) Console.WriteLine ("Main Window Title: \"{0}\"", main_window.Title); else - Console.WriteLine ("GladeWidgetAttribute is broken."); + Console.WriteLine ("WidgetAttribute is broken."); } public void OnWindowDeleteEvent (object o, DeleteEventArgs args) diff --git a/sample/Scribble.cs b/sample/Scribble.cs index 770bc82e7..2493bcf5a 100644 --- a/sample/Scribble.cs +++ b/sample/Scribble.cs @@ -69,10 +69,13 @@ namespace GtkSamples { Gdk.EventConfigure ev = args.Event; Gdk.Window window = ev.window; Gdk.Rectangle allocation = darea.Allocation; + + Console.WriteLine ("Darea=[{0}]" , darea); pixmap = new Gdk.Pixmap (window, allocation.width, allocation.height, -1); + Console.WriteLine ("Darea.Style={0}", darea.Style); pixmap.DrawRectangle (darea.Style.WhiteGC, 1, 0, 0, allocation.width, allocation.height);