[Gambas-user] array of object is SO needed
T Lee Davidson
t.lee.davidson at gmail.com
Wed Apr 1 06:12:14 CEST 2020
On 3/31/20 12:52 PM, roberto wrote:
>
> On 31/03/20 17:34, T Lee Davidson wrote:
>> On 3/31/20 6:16 AM, roberto wrote:
>>> At my eyes, absence of object arrays is the worsest weakness of gambas.
>>
>> http://gambaswiki.org/wiki/comp/gb/object[]
>>
>>
>
> thank!
>
> bad it is only in "code time" and not possible to do in "draw interface time" but is better than nothing.
>
> Question: how to interact with the single cell? i mean, if i want to (lets say) change the color of text red, green blue douleclick
>
> on the diffrent cell, where i have to write the relative code? for examble, i fan to click the cells different number of time to
>
> colo one in red, anohter in green, another in blue. is possible to do somethin like
>
> public sub object[1,2]_click()
>
> object[1,2].text="foo"
>
> end
>
> public sub object[1,2]_DoulbeClick()
>
> if object[1,2].tag="1" then
>
> object[1,2].background= green
>
> else
>
> object[1,2].background= red
>
> endif
>
> end
>
>
> public sub object[3,5]_click()
>
> object[1,2].text="bar"
>
> end
>
>
> and so on?
>
Well Label does not have a Click event. But you can use DblClick similar to the following:
Public Sub Form_Open()
Dim Squares As New Label[2]
Squares[0] = New Label(FMain) As "Squares"
Squares[0].x = 0
Squares[0].y = 0
Squares[0].Width = 50
Squares[0].Height = 28
Squares[0].Text = "Label1"
Squares[0].Show
Squares[1] = New Label(FMain) As "Squares"
Squares[1].x = 0
Squares[1].y = 30
Squares[1].Width = 100
Squares[1].Height = 35
Squares[1].Text = "Label2"
Squares[1].Show
End
Public Sub Squares_DblClick()
Print Last.Width, Last.Height
End
--
Lee
More information about the User
mailing list