Hi

I'm having problem using ClassDessigner to test subform
invocation. When the main form is run from Class
designer self.Application.biz = None.

The two forms I'm using for test are:-
<?xml version="1.0" encoding="ISO8859-1" standalone="no"?>
<dForm Name="dForm" SaveRestorePosition="False" Top="192" Caption="Dabo Class 
Designer" designerClass="DesForm" Left="250">
        <code>
                <createBizobjs><![CDATA[
def createBizobjs(self):
        print "(main) biz = %s" % self.Application.biz
]]>
                </createBizobjs>
        </code>

        <dSizer SlotCount="1" designerClass="LayoutSizer" 
Orientation="Vertical">
                <dPanel sizerInfo="{'HAlign': 'Left', 'VAlign': 'Top'}" 
designerClass="controlMix">
                        <dSizer SlotCount="1" designerClass="LayoutSizer" 
Orientation="Vertical">
                                <dButton Caption="Button" sizerInfo="{}" 
designerClass="controlMix">
                                        <code>
                                                <onHit><![CDATA[
def onHit(self, evt):
        unitDbox = dabo.ui.createForm("ui/testsub.cdxml")
        unitDbox.Show()
]]>
                                                </onHit>
                                        </code>
                                </dButton>
                        </dSizer>
                </dPanel>
        </dSizer>
</dForm>

and

<?xml version="1.0" encoding="cp1252" standalone="no"?>
<dForm SaveRestorePosition="False" designerClass="DesForm" Caption="Dabo Class 
Designer">
        <code>
                <createBizobjs><![CDATA[
def createBizobjs(self):
        print "(sub)  biz = %s" % self.Application.biz
        
]]>
                </createBizobjs>
        </code>

        <dSizer SlotCount="1" designerClass="LayoutSizer" 
Orientation="Vertical">
                <dPanel sizerInfo="{'HAlign': 'Left', 'VAlign': 'Top'}" 
designerClass="controlMix">
                        <dSizer SlotCount="1" designerClass="LayoutSizer" 
Orientation="Vertical">
                                <dPanel sizerInfo="{'BorderSides': ['All'], 
'HAlign': 'Left', 'VAlign': 'Top', 'Border': 0}" 
designerClass="LayoutPanel"></dPanel>
                        </dSizer>
                </dPanel>
        </dSizer>
</dForm>


An example of the difference between running them as aprt of an 
application and trhu class designer is here:-

knuth:/tmp/foo$ ./main.py  2>/dev/null
(main) biz = <module 'biz' from '/tmp/foo/biz/__init__.pyc'>
(sub)  biz = <module 'biz' from '/tmp/foo/biz/__init__.pyc'>
knuth:/tmp/foo$ ~/work/dabo/ide/ClassDesigner.py ui/testmain.cdxml 2>/dev/null
(main) biz = <module 'biz' from '/tmp/foo/biz/__init__.pyc'>
(sub)  biz = None
knuth:/tmp/foo$ 

Does anyone know why self.Application.biz goes away when
running code inside ClassDesigner ?


TTFN
-- 
Roger.                          Home| http://www.sandman.uklinux.net/
Master of Peng Shui.      (Ancient oriental art of Penguin Arranging)
Work|Independent Sys Consultant | http://www.computer-surgery.co.uk/
 New key Fpr: 72AF 0ACC 9A53 E59F B1B6  DC14 1983 A13E 5C3D 3CEB 


_______________________________________________
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