2003-01-01 Alp Toker <alp@atoker.com>

* glade/XML.custom: Determine name of GladeWidget if none specified
        * glade/GladeWidgetAttribute.cs: ditto

svn path=/trunk/gtk-sharp/; revision=10049
This commit is contained in:
Alp Toker 2003-01-01 23:53:21 +00:00
parent 3841924432
commit 9f6872634a
3 changed files with 19 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2003-01-01 Alp Toker <alp@atoker.com>
* glade/XML.custom: Determine name of GladeWidget if none specified
* glade/GladeWidgetAttribute.cs: ditto
2003-01-01 Rachel Hestilow <hestilow@ximian.com>
* glade/XML.custom: New method BindFields.

View file

@ -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; }
}
}
}

View file

@ -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);
}
}