On Tuesday 16 January 2007 11:35, Paul McNett wrote:
> johnf wrote:
> > 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.
>
> johnsClasses is a name in the main module's namespace. It exists only in
> that namespace. You need to explicitly import it into any other modules,
> for instance your form.
>
> I don't know how the imports for the cdxml files work, if there's one
> place where you can put them, but in any case it will work to just put
> an 'import johnsClasses' inside the form method where you want to
> instantiate that dialog.


So then the proper place is to import in the "afterInitAll"  for each and 
every form?  That seems wrong to me.  I'm back to where is my universal way 
to get my classes into the app.  
I'm still looking for "set classlib additive" and have access from any form.  
So if I do place an import statement into each form will I end up with multi 
copies of myclass in memory or just one?  As I currently understand it python 
checks to see if the module is in memory and uses it.  Is that right?   

OK maybe I need to hand code this.  So would one you please provide a simple 
hand coded example that opens a form, then calls a form from an event or form 
function.  The form does not need to be anything special - just a textbox 
with a button to call the second form.

Added question:  Is there a utility that converts cdxml files to python 
wxPthon code and allows me to save the code to a file?
-- 
John Fabiani

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

Reply via email to