[Gambas-user] control groups

Joao Pinto Lamego at ...99...
Sat Feb 21 22:48:14 CET 2004


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
>>..
>>    
>>
>
>
>
>-------------------------------------------------------
>SF.Net is sponsored by: Speed Start Your Linux Apps Now.
>Build and deploy apps & Web services for Linux with
>a free DVD software kit from IBM. Click Now!
>http://ads.osdn.com/?ad_id56&alloc_id438&op=click
>_______________________________________________
>Gambas-user mailing list
>Gambas-user at lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/gambas-user
>  
>




More information about the User mailing list