On Tuesday 11 August 2009 07:02:27 pm [email protected] wrote:
> In a message dated 8/11/2009 9:18:57 P.M. Eastern Daylight Time,
> [email protected] writes:
>
> Paul McNett wrote:
> > [email protected] wrote:
> >> I  changed the line that calls the dialog:
> >>
> >> from  :
> >>
> >>     dlg =  dabo.ui.createForm("findRun3.cdxml",  self)
> >>  dlg.show()
> >>
> >> to:
> >>
> >>   dlg = dabo.ui.createForm("findRun3.cdxml", show=True,   parent=self)
> >> #dlg.show()
> >>
> >> (I saw  these extra parameters on a post by Ed)
> >>
> >> Now  everything works fine!
> >>
> >> Any  explanations?
> >
> > Yes, here's the method signature:
> >
> > def createForm(srcFile, show=False, *args, **kwargs):
> >
> > So, the first parameter is whether or not to show the form. Change  your
> > code to:
> >
> > dlg = dabo.ui.createForm("my.cdxml",  False, self)
> >
> > --or--
> >
> > dlg =  dabo.ui.createForm("my.cdxml", *(self,))
> >
> > Clear as  mud?
> >
> > (so, before the change there wasn't a parent assigned to the  dialog,
> > which implicitly makes the app the parent, which probably  hung on to a
> > dangling reference until the next event  cycle.)
> >
> > Paul
>
> I played around with the dlg.show() line, and I think the behavior  was
> because in the original, the extra show was redundant. Somehow, the "self"
> parameter in
>
> dabo.ui.createForm("findRun3.cdxml",  self)
>
>
> caused the show to be true, and so the next line was redundant.  Doesn't
> seem to matter what the third (parent) parameter is.
>
> BTW, we've been trying to figure how to use functions based on the  way
> they are presented in the API documentation. I'm a bit confused. When the 
> docs say, for example,
>
> createForm(srcFile, show=False, *args, **kwargs)
>
> looks like the show parameter can be passed either as "True" or as
> "show=True".
>
> and how would we know from the documentation, that a third  parameter could
> be "parent=self"?
>
> (and is that an "*arg" or a "**kwarg"?)
>
> Jonathan

Maybe a better general question is where would one find an example of creating 
and using the method.  I can not find where the 'createForm' is described 
anywhere in the doc's.  That 
includes 'http://paul.dabodev.com/doc/api/dabodoc/' and anything on the wiki.  
How about writting something on the wiki after you get your app working?

Johnf




_______________________________________________
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