On 1/16/07, johnf <[EMAIL PROTECTED]> wrote:
> > > 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.
> >
>
> thanks but you are talking to a guy that barely understand generators and
> really does not understand how to use decorators or why.

See Paul's email about the separate file.  That is definitely the
easiest way to do it.  Then all you need is a dlg =
MyModalDialogClass() to define the dialog.  I keep forgetting that a
lot of people come from Fox Pro and don't fully understand the inner
workings of Python yet.....  I will try to get a tutorial up and
running today on this subject.

>
> Below is a simple app.  where do I define the class
> MyModalDialogClass(dabo.ui.dDialog): such that all other forms can see it.
>
> import os
> import inspect
> import dabo
>
>
> def main():
>         app = dabo.dApp()
>         curdir = os.getcwd()
>         # Get the current location's path
>         fname = inspect.getfile(main)
>         pth = os.path.split(fname)[0]
>         if pth:
>                 # Switch to that path
>                 os.chdir(pth)
>         app.MainFormClass = "custfrm1.cdxml"
>         app.start()
>
>         # Return to the original location
>         os.chdir(curdir)
>
>
> if __name__ == '__main__':
>         main()
>
> --
> 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

Reply via email to