On Wednesday 29 October 2008 07:38:50 am Ed Leafe wrote:
> On Oct 29, 2008, at 9:35 AM, johnf wrote:
> > Thanks guys.  Will the RegID work as a reference?
>
>       No, because that's form-dependent. Just grab the reference like this:
>
> pg2 = pageframe.Pages[2]
> pageframe.removePage(pg2, False)
>
> ... then later:
> pageframe.insertPage(2, pg2)
>
>
> -- Ed Leafe

I'm having trouble with the insert.  I think the problem is the way I setup 
the class for my pages and a possible bug in the way dPageFrameMixin.py 
handles my classes.

First I create the class as follows:
class LotInfo1(dabo.ui.dPanel):
        def afterInit(self):
                self.RegID='InfoPanelID'
                self.Sizer = dabo.ui.dSizer("v")
                gs = dabo.ui.dGridSizer(MaxCols=7,HGap=2,VGap=3)
                gs.append(dabo.ui.dLabel(self, RegID='lblvendID', Caption=" 
Vendor # "), 
halign="right") ....

I then add the class as follows:
pageFrame = pgf = dabo.ui.dPageFrame(self,RegID='LotPageFrameID')
pgf.appendPage(pgCls=InfoPanel, caption="Information")
self.Form.pg0 = pgf.Pages[0]

The above works.  I get the tabs I want and they work correctly.  I also have 
a reference to the page.

But when I attempt to insertPage(0,pgCls=self.pg0,caption='MyTest') I get
the object is not callable because in dPageFrameMixin.py the following line is 
called

line 175
pg=pgCls(self) .

Well of course a dPanel is not callable.  

this does work 
try:
  pg=pgCls(self)
except:
  pg=pgCls

Also I'm losing the caption of the page when I restore/insert.

So the question is should I change the class or is there something wrong in 
dPageFrameMixin?
-- 
John Fabiani


_______________________________________________
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