On Sep 27, 2009, at 8:00 PM, Ricardo Aráoz wrote:

> Hi, I must now instantiate a modal form from a button in my main form.
> Been reading the archives and this is what I came up with. Is this the
> way to go?
>
> def onHit_myButton(self, evt):
>   dlg = dabo.ui.createForm("ui/myDialog.cdxml")
>    dlg.showModal()

        Dialogs are modal, so all you need is show().

>    if dlg.Accepted :
>       result1 = dlg.someProperty
>       result2 = dlg.someOtherProperty
>    dlg.release()
>    self.processDialogResults(result1, result2)
>
> And in the dialog in the onHit event of the Ok button I'd have
> "self.hide()" in order to close the dialog and return to the calling  
> form.


        If you use either dOkCancelDialog or dYesNoDialog, the 'hide' will be  
done for you. Otherwise, yes, you should call hide() so that the  
dialog is not destroyed.


-- Ed Leafe





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to