On Jan 1, 2012, at 7:22 PM, OKB (not okblacke) wrote:

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

        Usually things get added as they are needed. As far as I know, this is 
the first request for such a behavior, which would explain why the hook hasn't 
been created. :-)

        I wrote that previous solution off the top of my head; another 
alternative would be to store the params you want the form to receive in a dict 
attribute of the app itself. Then the only thing you would need to do is change 
the form to look for anything in self.Application.formParams (or whatever you 
call it), and process them accordingly. I'm sure that there are a bunch of 
other approaches, too.

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

        Like I said above, I don't believe that anyone has ever suggested this 
approach to customization before. The only thing even close would be forms that 
read some sort of .ini file or similar when they are created, but that doesn't 
seem to be what you're doing. You want to be able to create the app with 
parameters and have the form receive them. Maybe we could add a 
MainFormParameters property to dApp that would take a dict of params, and these 
would be passed to the MainFormClass when it is instantiated as its kwargs. 

        Paul, I'm hoping that you'll chime in here with any thoughts on this 
approach.


-- Ed Leafe



_______________________________________________
Post Messages to: [email protected]
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/[email protected]

Reply via email to