dabo Commit
Revision 1513
Date: 2005-11-03 21:01:05 -0800 (Thu, 03 Nov 2005)
Author: paul

Changed:
U   trunk/dabo/ui/uiwx/dPageFrameMixin.py

Log:
Found and fixed a platform inconsistency with raising of page changed events.
On Linux, pageframe.GetSelection() would return the new page in the event
handler, but Windows would return the prior page. Changed the code to raise
the dabo events in a callAfter instead, which seems to have fixed the problem.
I still need to test on Mac.

Added eventData for oldPageNum and newPageNum in the PageChanged event.


Diff:
Modified: trunk/dabo/ui/uiwx/dPageFrameMixin.py
===================================================================
--- trunk/dabo/ui/uiwx/dPageFrameMixin.py       2005-11-03 21:43:57 UTC (rev 
1512)
+++ trunk/dabo/ui/uiwx/dPageFrameMixin.py       2005-11-04 05:01:05 UTC (rev 
1513)
@@ -35,14 +35,17 @@
 
                
        def __pageChanged(self, newPageNum, oldPageNum):
+               ## Because of platform inconsistencies, it is safer to raise 
the dabo
+               ## events in a callafter instead of directly.
                self._lastPage = newPageNum
                if oldPageNum is not None:
                        if oldPageNum >=0:
-                               
self.Pages[oldPageNum].raiseEvent(dEvents.PageLeave)
+                               
dabo.ui.callAfter(self.Pages[oldPageNum].raiseEvent, dEvents.PageLeave)
 
                if newPageNum >= 0 and self.PageCount > newPageNum:
-                       self.Pages[newPageNum].raiseEvent(dEvents.PageEnter)
-                       self.raiseEvent(dEvents.PageChanged)
+                       dabo.ui.callAfter(self.Pages[newPageNum].raiseEvent, 
dEvents.PageEnter)
+                       dabo.ui.callAfter(self.raiseEvent, dEvents.PageChanged, 
+                                       oldPageNum=oldPageNum, 
newPageNum=newPageNum)
                        
                
        # Image-handling function




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

Reply via email to