File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -383,6 +383,12 @@ def _show_message(self,s):
383383 # Fixes a PySide segfault.
384384 self .window .statusBar ().showMessage (s )
385385
386+ def full_screen_toggle (self ):
387+ if self .window .isFullScreen ():
388+ self .window .showNormal ()
389+ else :
390+ self .window .showFullScreen ()
391+
386392 def _widgetclosed ( self ):
387393 if self .window ._destroying : return
388394 self .window ._destroying = True
@@ -394,7 +400,6 @@ def _widgetclosed( self ):
394400 # Gcf can get destroyed before the Gcf.destroy
395401 # line is run, leading to a useless AttributeError.
396402
397-
398403 def _get_toolbar (self , canvas , parent ):
399404 # must be inited after the window, drawingArea and figure
400405 # attrs are set
Original file line number Diff line number Diff line change @@ -529,9 +529,8 @@ def set_window_title(self, title):
529529 self .window .wm_title (title )
530530
531531 def full_screen_toggle (self ):
532- # cross platform way of maximizing a tk window
533- # http://devourer09.blogspot.co.uk/2009/07/maximizing-tkinter-app.html
534- self .window .attributes ('-zoomed' , '1' )
532+ is_fullscreen = bool (self .window .attributes ('-fullscreen' ))
533+ self .window .attributes ('-fullscreen' , not is_fullscreen )
535534
536535
537536class AxisMenu :
@@ -919,4 +918,4 @@ def hidetip(self):
919918 tw = self .tipwindow
920919 self .tipwindow = None
921920 if tw :
922- tw .destroy ()
921+ tw .destroy ()
You can’t perform that action at this time.
0 commit comments