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):
383
383
# Fixes a PySide segfault.
384
384
self .window .statusBar ().showMessage (s )
385
385
386
+ def full_screen_toggle (self ):
387
+ if self .window .isFullScreen ():
388
+ self .window .showNormal ()
389
+ else :
390
+ self .window .showFullScreen ()
391
+
386
392
def _widgetclosed ( self ):
387
393
if self .window ._destroying : return
388
394
self .window ._destroying = True
@@ -394,7 +400,6 @@ def _widgetclosed( self ):
394
400
# Gcf can get destroyed before the Gcf.destroy
395
401
# line is run, leading to a useless AttributeError.
396
402
397
-
398
403
def _get_toolbar (self , canvas , parent ):
399
404
# must be inited after the window, drawingArea and figure
400
405
# attrs are set
Original file line number Diff line number Diff line change @@ -529,9 +529,8 @@ def set_window_title(self, title):
529
529
self .window .wm_title (title )
530
530
531
531
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 )
535
534
536
535
537
536
class AxisMenu :
@@ -919,4 +918,4 @@ def hidetip(self):
919
918
tw = self .tipwindow
920
919
self .tipwindow = None
921
920
if tw :
922
- tw .destroy ()
921
+ tw .destroy ()
You can’t perform that action at this time.
0 commit comments