Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fullscreen rather than maximize in Tk. Added fullscreen support to qt…
…4 backend.
  • Loading branch information
Phil Elson authored and pelson committed Jun 24, 2012
commit dc77096c23d7ee153c712d63d07dfa16be645ae0
7 changes: 6 additions & 1 deletion lib/matplotlib/backends/backend_qt4.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,12 @@ def _show_message(self,s):
# Fixes a PySide segfault.
self.window.statusBar().showMessage(s)

def full_screen_toggle(self):
if self.window.isFullScreen():
self.window.showNormal()
else:
self.window.showFullScreen()

def _widgetclosed( self ):
if self.window._destroying: return
self.window._destroying = True
Expand All @@ -394,7 +400,6 @@ def _widgetclosed( self ):
# Gcf can get destroyed before the Gcf.destroy
# line is run, leading to a useless AttributeError.


def _get_toolbar(self, canvas, parent):
# must be inited after the window, drawingArea and figure
# attrs are set
Expand Down
7 changes: 3 additions & 4 deletions lib/matplotlib/backends/backend_tkagg.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,8 @@ def set_window_title(self, title):
self.window.wm_title(title)

def full_screen_toggle(self):
# cross platform way of maximizing a tk window
# http://devourer09.blogspot.co.uk/2009/07/maximizing-tkinter-app.html
self.window.attributes('-zoomed', '1')
is_fullscreen = bool(self.window.attributes('-fullscreen'))
self.window.attributes('-fullscreen', not is_fullscreen)


class AxisMenu:
Expand Down Expand Up @@ -919,4 +918,4 @@ def hidetip(self):
tw = self.tipwindow
self.tipwindow = None
if tw:
tw.destroy()
tw.destroy()