On 7/17/07, Ed Leafe <[EMAIL PROTECTED]> wrote:
> On Jul 16, 2007, at 9:38 PM, Nate Lowrie wrote:
>
> >>         Show me the code you're using to set the DynamicCaption,
> >> as well as
> >> the dynamic method itself.
> >
> >         def afterInit(self):
> >                 #controlCode
> >               self.DynamicCaption = self.getPageCaption
> >
> >       def getPageCaption(self):
> >               return self.Editor.FileName
>
>         Is this for the pageframe or the page itself? Try this:


That code works.  Then I modified it to reflect how I was doing it.  I
used the following code:

import dabo
dabo.ui.loadUI("wx")
import time

class TestPage(dabo.ui.dPanel):
        def getTabCaption(self):
                print time.ctime(), "GETTIME"
                return time.ctime()

class TestPGF(dabo.ui.dPageFrame):
       def afterInit(self):
               self.appendPage(TestPage)
               pg = self.Pages[-1]
               pg.DynamicCaption = pg.getTabCaption



class TestForm(dabo.ui.dForm):
       def afterInit(self):
               pgf = TestPGF(self)
               btn = dabo.ui.dButton(self, Caption="Update",
                               OnHit=self.onBtnUpdate)
               sz = self.Sizer
               sz.append1x(pgf)
               sz.append(btn, border=8)

       def onBtnUpdate(self, evt):
               self.update()

app = dabo.dApp()
app.MainFormClass = TestForm
app.start()

This code did not update the tab text.  It would dive into the
getTabCaption function and correctly print out the value, but I cannot
get it to display the value on the tab.

>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> import dabo
> dabo.ui.loadUI("wx")
> import time
>
> class TestPGF(dabo.ui.dPageFrame):
>         def afterInit(self):
>                 self.PageCount = 2
>                 pg0 = self.Pages[0]
>                 pg0.DynamicCaption = self.getTime
>
>         def getTime(self):
>                 print time.ctime(), "GETTIME"
>                 return time.ctime()
>
> class TestForm(dabo.ui.dForm):
>         def afterInit(self):
>                 pgf = TestPGF(self)
>                 btn = dabo.ui.dButton(self, Caption="Update",
>                                 OnHit=self.onBtnUpdate)
>                 sz = self.Sizer
>                 sz.append1x(pgf)
>                 sz.append(btn, border=8)
>
>         def onBtnUpdate(self, evt):
>                 self.update()
>
> app = dabo.dApp()
> app.MainFormClass = TestForm
> app.start()
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
>
> -- Ed Leafe
> -- http://leafe.com
> -- http://dabodev.com
>
>
>
>
[excessive quoting removed by server]

_______________________________________________
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/dabo-users/[EMAIL PROTECTED]

Reply via email to