File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -292,13 +292,19 @@ def GoPage(self, pagenum):
292292 :param integer `pagenum`: go to the provided page number if it is valid
293293
294294 """
295+ # calling Scroll sometimes doesn't raise wx.EVT_SCROLLWIN eg Windows 8 64 bit - so
296+ wx .CallAfter (self .Render )
297+
298+ if not hasattr (self , "cumYpagespixels" ):
299+ return False # This could happen if the file is still loading
300+
295301 if pagenum > 0 and pagenum <= self .numpages :
296302 self .Scroll (0 , self .cumYpagespixels [pagenum - 1 ] //
297303 self .GetScrollPixelsPerUnit ()[1 ])
304+ return True
298305 else :
299306 self .Scroll (0 , 0 )
300- # calling Scroll sometimes doesn't raise wx.EVT_SCROLLWIN eg Windows 8 64 bit - so
301- wx .CallAfter (self .Render )
307+ return False
302308
303309 @property
304310 def ShowLoadProgress (self ):
You can’t perform that action at this time.
0 commit comments