On Jan 24, 2007, at 5:18 PM, Uwe Grauer wrote:

> I tried to add a property "ParentForm" to a childform to be able
> to call createForm("myform.cdxml", ParentForm=self) in my parentform.
> So, if they have types we should add all python types.
>
> Not very nice for a dynamic language.

        Why would this be a property? Sounds like a simple attribute to me.

        Anyway, the other reason for specifying the type is if you have a  
default value. Since everything gets typed in the dialog as a string,  
I need to be able to format it correctly when generating the class  
code. The difference between these two statements:

self.MyProp = "42"
        -and-
self.MyProp = 42

        ... depends on being able to know if the value you entered is a  
string or an int. If you don't set a default value, you don't need to  
specify a type.

> One more:
> Should i be able to use the property like self.ParentForm in my
> childform?
> Doesn't seem to be working.

        If there is an error in the code, the property definition will fail,  
and of course it won't be available. But otherwise, yes, you should  
be able to reference it just like any other property.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com



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

Reply via email to