On 1/16/07, johnf <[EMAIL PROTECTED]> wrote:
> On Tuesday 16 January 2007 09:15, Ed Leafe wrote:
> > On Jan 16, 2007, at 12:03 PM, johnf wrote:
> > > In your example where was the class MyModalDialogClass defined?
> >
> > It depends. It could be in a separate file, or somewhere within the
> > current program. That usually depends on whether it will be in just
> > that one place or not. If it is in a different file, you'll have to
> > import it to get the class definition in the current namespace.
> >
> > > Would you call the
> > > dlg = self.parent.MyModalDialogClass(self) in the form
> > > or
> > > something else from the button function/form function.
> >
> > The class isn't an attribute of the object's parent; it's just a
> > class.
> >
> > If I had a button, the code in the button would be nothing more than:
> >
> > self.Form.doWhatever()
> >
> > ...where the form's doWhatever() method is what contains what you
> > need to happen.
> >
> > The code in the form method could look like:
> >
> > from MyCustomDialogs import MyModalDialogClass
> >
> > dlg = MyModalDialogClass()
> > ...etc.
> >
> > ...or it could look like:
> >
> > class MyModalDialogClass(dabo.ui.dDialog):
> > def addControls(self):
> > ... <add stuff>
> >
> > dlg = MyModalDialogClass()
> > ...etc.
> >
> >
> > -- Ed Leafe
> > -- http://leafe.com
> > -- http://dabodev.com
>
> Thanks again!
>
> That works - now what if I want the dialog form class to be universally
> available to all forms?
>
Use this model that Ed described before. Add you controls to the
dialog in the class.
class MyModalDialogClass(dabo.ui.dDialog):
def addControls(self):
... <add stuff>
Then, anytime a form wants to call the dialog, use syntax like the one
below. It's just like instantiating a regular python object.........
Call dlg.show() to display the dialog and get the modal property.
dlg = MyModalDialogClass()
dlg.show()
...etc.
> --
> John Fabiani
>
> _______________________________________________
> Post Messages to: [email protected]
> Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
>
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev