From 9f6872634a134e3b1e62485715633e0ddc132601 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Wed, 1 Jan 2003 23:53:21 +0000 Subject: [PATCH] 2003-01-01 Alp Toker * glade/XML.custom: Determine name of GladeWidget if none specified * glade/GladeWidgetAttribute.cs: ditto svn path=/trunk/gtk-sharp/; revision=10049 --- ChangeLog | 5 +++++ glade/GladeWidgetAttribute.cs | 12 ++++++++++++ glade/XML.custom | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 30c61e912..40e30e03b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2003-01-01 Alp Toker + + * glade/XML.custom: Determine name of GladeWidget if none specified + * glade/GladeWidgetAttribute.cs: ditto + 2003-01-01 Rachel Hestilow * glade/XML.custom: New method BindFields. diff --git a/glade/GladeWidgetAttribute.cs b/glade/GladeWidgetAttribute.cs index c637fec22..2cffbc107 100644 --- a/glade/GladeWidgetAttribute.cs +++ b/glade/GladeWidgetAttribute.cs @@ -11,16 +11,28 @@ namespace Glade { public class GladeWidgetAttribute : Attribute { private string name; + private bool specified; public GladeWidgetAttribute (string name) { + specified = true; this.name = name; } + public GladeWidgetAttribute () + { + specified = false; + } + public string Name { get { return name; } } + + public bool Specified + { + get { return specified; } + } } } diff --git a/glade/XML.custom b/glade/XML.custom index 205bff8d8..6bf2b52ef 100644 --- a/glade/XML.custom +++ b/glade/XML.custom @@ -268,7 +268,8 @@ // The widget to field binding must be 1:1, so only check // the first attribute. GladeWidgetAttribute widget = (GladeWidgetAttribute) attrs[0]; - field.SetValue (target, GetWidget (widget.Name), flags, null, null); + if (widget.Specified) field.SetValue (target, GetWidget (widget.Name), flags, null, null); + else field.SetValue (target, GetWidget (field.Name), flags, null, null); } }