[MonoDevelop] Loop through all the controls on the active form in Gtk#?
Ruben Guinez
rubenvive at gmail.com
Tue Oct 30 20:11:09 EDT 2007
Thanks a lot, Jon.
My way is clear now.... I got the idea, I will work from this...
On 10/30/07, Jon Cosby <jon at jcosby.com> wrote:
> Ruben Guinez wrote:
> > How I can do that?.
> > In C#, but in Windows Forms .Net Window I can to do that. But with in
> > Gtk# not yet !.
> >
> > Please, Can anybody help me?
> >
> > Thanks in advance...
> >
>
> GTK# widgets are children to their containers. You have to iterate
> through each container.
>
>
> Gtk.Widget[] widgets1 = this.vbox1.Children;
> Gtk.Widget[] widgets2;
> foreach(Widget w1 in widgets1)
> {
> if (w1 is Gtk.HButtonBox)
> {
> HButtonBox hbbox = (HButtonBox) w1;
> widgets2 = hbbox.Children;
> foreach (Widget w2 in widgets2)
> {
> Button btn = (Button) w2;
> btn.Label = "Hello";
> }
> }
> }
>
>
>
> Jon Cosby
> _______________________________________________
> Monodevelop-list mailing list
> Monodevelop-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monodevelop-list
>
--
Rubén D. Guíñez G.
Software Developer
More information about the Monodevelop-list
mailing list