[Gambas-user] Gambas Help - PLEASE - Object Arrays - Need help ASAP
Fabien Bodard
gambas.fr at ...626...
Thu Nov 6 14:08:42 CET 2008
robert can you write your question in a more detailled way, ...
because i can explain you ... but do you want to know ?
to know which button ... you can just put a numer in each in the tag
property ...
then in the event you get the number by Last.Tag
For i = 0 to 10
hBut = New Button(me) as "MyBut"
hBut.tag = i
hBut.Caption = "button " & i
next
Public sub MyBut_Click
Print Last.Tag
where last is your button :)... there is not always the need to
maintain an array of reference to it ... as vb do
End
2008/11/6 Robert Moss <the.at.robert at ...626...>:
> Ok, awesome. But what is a control group and how do I use one? I can't find
> any documentation on it
>
> On Thu, Nov 6, 2008 at 4:16 AM, Stefano Palmeri <rospolosco at ...152...>wrote:
>
>> Il giovedì 6 novembre 2008 13:05:42 Robert Moss ha scritto:
>> > Hello, I am fairly new to GAMBAS but a experienced in C++ and VB 6. I am
>> > trying to create an array of sockets, so that I can maintain a dynamic
>> > number of connections, and use the same code for each.
>> >
>> > I've been struggling for HOURS searching for the answer on google, and
>> > trying as much different code as I can think of, experimenting, but to no
>> > avail. I can create the objects, but I can't figure out how to receive
>> > messages from them (actually I can't figure out how to distinguish them).
>> >
>> > A simpler example with buttons: This works, but I need to know WHICH
>> > button fired the event,
>> >
>> > PUBLIC SUB Form_Open()
>> >
>> > DIM btns[2] AS Button
>> >
>> > btns[0] = NEW Button(FMain) AS "btns"
>> >
>> > btns[0].Caption = "Test"
>> > btns[0].Left = 50
>> > btns[0].Top = 50
>> > btns[0].Show
>> >
>> > btns[1] = NEW Button(FMain) AS "btns"
>> >
>> > btns[1].Caption = "Test 2"
>> > btns[1].Left = 150
>> > btns[1].Top = 50
>> >
>> > btns[1].Show
>> >
>> > END
>> >
>> > PUBLIC SUB btns_Click()
>> > Message.Info("augh: ")
>> > END
>> > ' using PUBLIC SUB btns_Click(Index as Integer) doesnt work
>> > ' nor does PUBLIC SUB btns[key]_Click()
>> >
>> > 'also, using the current function, I tried maybe Message.Info("ID: " &
>> > btns.Id) or ANYTHING
>> >
>> > This functionality is CRUCIAL please help asap.
>> >
>> > -Robert
>> > -------------------------------------------------------------------------
>> > This SF.Net email is sponsored by the Moblin Your Move Developer's
>> > challenge Build the coolest Linux based applications with Moblin SDK &
>> win
>> > great prizes Grand prize is a trip for two to an Open Source event
>> anywhere
>> > in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> > _______________________________________________
>> > Gambas-user mailing list
>> > Gambas-user at lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>> PUBLIC SUB btns_Click()
>>
>> Message.Info("augh: ")
>>
>> PRINT LAST.Caption
>>
>> END
>>
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> 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