[Gambas-user] Array of Runtime Objects

-=FoX=- _root at ...324...
Sun Jan 11 18:09:42 CET 2004


Hi :-D

There is a panel, with a button "ADD" and a button "REMOVELAST"
When I click "ADD", I add to my object array a new object and a new 
object appear under the 2 buttons. Think playcards...
When I click "REMOVELAST", I call a Playcard sub that delete the 
principal panel of the playcard and then resize the array ( - 1 object)
And is *ALL* ok. :)

Suppose that every playcard have a button "KILLME" that kill itself.
----    ----    ----    ----
| 0 |     | 1 |    | 2  |    | 3 |
----    ----    ----    ----
Suppose also that i want remove the card nuumber "2"
----    ----              ----
| 0 |     | 1 |              | 3 |
----    ----              ----

Now, the question:
can I raise a main event from a playcard event?
The "KILLME" clik launch the sub "destroycard" in the main window.
In the main i have a sub that kill the objecr card2 and remove  array[2]
then i have a sub that refresh the cards position

In alternative, i make a timer in main window, that check if the 
variable "alive" of every card is 1 or zero.
When i click "KILLME" i set alive to 0 and so the timer call the sub 
that destroy the card.
Then i must to refresh the array to remove the "hole" :D

I don't like the second way :/
Any idea?

Thanks in advance





More information about the User mailing list