[Gtk-sharp-list] Glade# signal/handler pass object

Leo Spalteholz leo@thewoodpecker.ca
Sun, 23 Nov 2003 23:01:25 -0800


On November 23, 2003 10:37 pm, Leo Spalteholz wrote:
> On November 23, 2003 04:16 pm, Alejandro S=E1nchez wrote:
> > I have a glade object
> >
> > <widget class=3D"GtkButton" id=3D"button">
> >   <property name=3D"width_request">15</property>
> >   <property name=3D"height_request">15</property>
> >   <property name=3D"visible">True</property>
> >   <property name=3D"relief">GTK_RELIEF_NONE</property>
> >   <signal name=3D"clicked" handler=3D"OnButtonClicked" object=3D"widget"
> > last_modification_time=3D"Sat, 22 Nov 2003 15:56:35 GMT"/>
> >
> > How would be OnButtonClicked declaration in C#? How to retrieve object
> > "widget" in the function?
> >
> > And with all in C# code?
> >
> > Button button =3D new Button;
>
> should be: Button button =3D new Button();
>
> > button.Clicked +=3D new EventHandler(OnButtonClicked);
>
> void OnButtonClicked(object obj, EventArgs args) {
> 	// get widget, in this case your button
> 	Button button =3D (Button)(obj);
> }
>
> Leo

On second read..  Did you want the pure C# way of doing it or how to do it=
=20
with glade#?  Well the above is how to do it in C#...   Sorry, I don't=20
know anything about glade#.

leo