Re: [dabo-users] Pass parameters to main form

Author: OKB (not okblacke)

Posted: 2012-01-01 at 20:22:00

Ed Leafe wrote:

> The difficulty here is that you want to pass information to

> the form before the form instance is created. Perhaps you

> could create a classmethod in your form class that would

> accept these additional parameters, and store them in class

> attributes. Then they could be retrieved and acted upon in the

> __init__() of the form. Something like:

>

> (in the form class)

>

> @classmethod

> def storeSetupValues(cls, projectName=None, dataFile=None, ...):

> cls.projectName = projectName

> cls.datafile = dataFile

> ...

>

> def __init__(self, ...):

> super(MyFormClass, self).__init__(...)

> self.doExtraSetup()

>

> def doExtraSetup(self):

> self.readDataFile(self.datafile)

> ...

Thanks for your quick reply. I had considered overriding __init__

but it seems a rather extreme solution. It's rather odd that with all

of Dabo's customized initialization stuff (afterInit, afterInitAll,

etc.), there's no hook that allows information to be passed in from the

outside. Anyway, I'll look at doing something like this.

What you mention about passing information before the form instance

is created, though, makes me wonder a bit about the bigger picture. I

suppose it's true that I want to pass information before the instance is

created, but that's only because Dabo hides the instance creation inside

its own innards. It doesn't much matter to me whether I pass my

information when I create the app instance, or when I specify the app's

main form, or when I do app.start(). But, as far as I can tell, at none

of those three places is there a way to pass information in. Is there

some other place to do it? What would it mean to pass it in after the

instance is created? It seems like that would mean passing it in once

the GUI app is already up and running, but that defeats the purpose of

passing it in order to influence initialization.

--

--OKB (not okblacke)

Brendan Barnwell

"Do not follow where the path may lead. Go, instead, where there is

no path, and leave a trail."

--author unknown

_______________________________________________

Post Messages to: Dabo-users@leafe.com

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/Xns9FCDB0508FDC4OKB@80.91.229.10

©2012 OKB (not okblacke)