[Gambas-user] Event of a runtime object

-=FoX=- _root at ...324...
Thu Jan 8 01:13:59 CET 2004


Hi ;-)
I  have a problem to understand how I can manage events of runtime 
objects :-(
Suppose that:
I have a Form with a panel (PanelA) and a button  (ButtonA)
For some reason at the click of the ButtonA I must create into PanelA 
another panel (PanelB) that contains another button (ButtonB)
Now, suppose that i want to change color of PanelB when I click ButtonB.

Suppose also that PanelB and ButtonB are a separate Class.

--------------------------------------------------
-FmMain.class-
--------------------------------------------------
'Gambas class file
PUBLIC myexample AS ClFrame
...
PUBLIC SUB ButtonA_Click()
    myexample = NEW ClFrame(PanelA)
END

--------------------------------------------------
-ClFrame.class-
--------------------------------------------------
'Gambas class file
PUBLIC PanelB AS Panel
PUBLIC ButtonB AS Button

PUBLIC SUB _new(bbox as Container)

    PanelB = NEW Panel(bbox)   
    PanelB.X ...blabla
    yattaya...

    ButtonB = NEW Button(PanelB)
    ButtonB.X = ...
    blabla
    blabla
END

I suppose it is *WRONG* :
PUBLIC SUB ButtonB_Click()
    Make something
END

How I can make this?

Thankyou in advance
Fox





More information about the User mailing list