[Gambas-user] control groups

Benoit Minisini gambas at ...1...
Sat Feb 21 23:37:10 CET 2004


On Saturday 21 February 2004 22:48, Joao Pinto wrote:
> Well,
> thanks for the fast reply.
> I have tried both Benoit's and your suggestion and they didn't work.
> However I decided to move the object creation to the Form_Open event and
> the click event is now working for the group.
>
> I am not sure why is it working just like this, maybe is just binding
> the events to the group after the .show method beeing called ?
>
> Anyway, I can continue developing my game now :)
> ...
>
> PUBLIC SUB Form_Open()
>   DIM hButton[3] AS Button
> hButton[0] = NEW Button(ME) AS "MyButtons"
> hButton[0].Text = "Red"
>
> hButton[1] = NEW Button(ME) AS "MyButtons"
> hButton[1].Text = "Green"
> hButton[1].Y = 50
>
> hButton[2] = NEW Button(ME) AS "MyButtons"
> hButton[2].Text = "Blue"
> hButton[2].Y = 100
> END
>   ...
>
> João Luís Marques Pinto
> PTlink Technical Administrator
> Lamego at ...99...
> http://www.ptlink.net
>
> Daniel Campos wrote:
> >El sáb, 21-02-2004 a las 22:17, Joao Pinto escribió:
> >>Hello,
> >>are control groups working ?
> >>I have tried the following example from the help but the click event
> >>code is not being executed.
> >>
> >>..
> >>' Gambas class file
> >>STATIC PUBLIC SUB Main()
> >>  DIM FMain AS Form
> >>  DIM hButton[3] AS Button
> >
> >mmmhh... you are using three objects that just exists in the SUB Main(),
> >I mean in that function scope... may be you should define them as
> >'PUBLIC' or 'PRIVATE' in the begging of the formulary, not into a
> >method,I think this is the problem
> >
> >>  FMain = NEW Form1
> >>
> >>
> >>hButton[0] = NEW Button(Fmain) AS "MyButtons"
> >>hButton[0].Text = "Red"
> >>
> >>hButton[1] = NEW Button(Fmain) AS "MyButtons"
> >>hButton[1].Text = "Green"
> >>hButton[1].Y = 50
> >>
> >>hButton[2] = NEW Button(Fmain) AS "MyButtons"
> >>hButton[2].Text = "Blue"
> >>hButton[2].Y = 100
> >>  FMain.show
> >>END
> >>PUBLIC SUB MyButtons_Click()
> >>
> >>  lblTxt.text = LAST.Text
> >>END
> >>..

This story is not clear! Could you send me your initial not working project, 
so that I can understand what happens ?

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list