On 1/16/07, johnf <[EMAIL PROTECTED]> wrote:
> On Tuesday 16 January 2007 10:15, Nate Lowrie wrote:
> > On 1/16/07, johnf <[EMAIL PROTECTED]> wrote:
> > > On Tuesday 16 January 2007 09:50, Paul McNett wrote:
> > > > johnf wrote:
> > > > > That works - now what if I want the dialog form class to be
> > > > > universally available to all forms?
> > > >
> > > > Then you break it out into a MyDialog.py file, contents like:
> > > >
> > > > import dabo
> > > >
> > > > class MyDialog(dabo.ui.dDialog):
> > > >       ...
> > > >
> > > > You put the MyDialog.py file somewhere accessible to your forms (same
> > > > directory for simplicity is better. This is why I like the AppWizard's
> > > > ui/ directory). Then where you want to use it, do:
> > > >
> > > > import MyDialog
> > > > dlg = MyDialog.MyDialog(...)
> > > > dlg.showModal()
> > >
> > > So I gather that it's OK to have multiple import statements of the same
> > > import everywhere.   In VFP an universal function, procedure or class
> > > would be loaded at the beginning of an app.
> > >
> > > Set procedure to someProcedure or
> > > set classlib to someclass additive
> >
> > The import statement would be the equivalent of that.  Also consider
> > brushing up on Python Classes and how they are instantiated into
> > objects.
> >
> > > I have no need to add something like above?
> > >
> > > --
> > > John Fabiani
>
> No doubt I need to review most of Python.
>
> But I would have thought that I would create a file which contained my classes
> and import it at the beginning.
>
> import dabo
> import johnsClasses
>
> Then within a form I could say something like
> new_frm = johnsClasses.MydialogClass() #if this wrong say so please
> new_frm.show()
>
> I was sure I was right - but it does not work.  I'm missing something or
> coding something wrong.

Sounds right.  You are doing what we suggested.  Can you provide a
stack trace or something to help us help you?

>
>
>
> --
> 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