On Nov 5, 2010, at 8:28 PM, Carey Gagnon wrote:

> def openDashboard(self,evt):
>      self.close()
>      val = self.confirmChanges()

        You are actually calling confirmChanges() twice! The normal process for 
the close() method is to check for pending changes by calling the 
confirmChanges() method.

>      if val == True:

        Python tip: you never compare anything to True or False. Instead, just 
use the boolean directly:

        if val:

>          dabo.ui.createForm("frmDashboard.cdxml", show=True, parent=None)
>    else:
>        pass

        Another Python tip: the 'else' block is optional; if you don't need to 
do anything when the 'if' statement isn't true, just leave the 'else' part off.

        If I were to try to code something like what you want, I'd call the 
confirmChanges() first, and then, if canceled, exit the the method:

def openDashboard(self, evt):
        if self.confirmChanges() is None:
                return
        self.close()
        dabo.ui.createForm("frmDashboard.cdxml", show=True, parent=None)


        Hope that helps!


-- Ed Leafe



_______________________________________________
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