On Mar 2, 2007, at 4:42 PM, Antonio Dias wrote:

> Ed, I think you didn't undersand...

        I think you're right! ;-)

> in formA I have a grid and a button.
> clicking on the button I want to show the formB
>
> I created the callb() function under formA
> ==
> def callb(self):
>    formB = createForm("formB.cdxml")  =or=>  self.formB = ... it  
> dont work
>    formB.show() =or=> self.formB.show()
> ==
>
> on the event of the button in formA, the following codes don't work
> ==
> def onHit(self, evt):
>    formA.callb()  <-- dont work - error: global variable formA not  
> defined
> or
>     self.formA.callb() <--dont work - error: button has no  
> attribute formA
>
> what I did wrong??

        OK, now I see. In the button method you want to call a method of its  
form. Every object on a form has a reference to its containing form:  
its 'Form' property. So your code should be:

self.Form.callb()


-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to