Commit 737d469b authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

RF: Adjust screenshot function so it defaults to the first view

parent 53904068
......@@ -380,8 +380,12 @@ class BackgroundIPythonKernel(object):
return self.__error
def __screenshot(self, view):
"""Insert a screenshot of the given view into the notebook. """
def __screenshot(self, view=None):
"""Insert a screenshot of the given view panel into the notebook.
If ``view`` is not specified, the first view is assumed.
"""
if view is None:
view = self.__frame.viewPanels[0]
with tempdir.tempdir():
screenshot.screenshot(view, 'screenshot.png')
return display.Image('screenshot.png')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment