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

Skip to content
Merged
Changes from 2 commits
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
15 changes: 9 additions & 6 deletions galleries/examples/user_interfaces/embedding_in_wx5_sgskip.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
Embed in wx #5
==============

.. tip::

:class:`wx.lib.mixins.inspection.InspectableApp` is a drop-in
replacement for :class:`wx.App` that opens an inspection window
letting you browse the live widget and sizer tree. It is a useful
debugging aid when embedding Matplotlib in wxPython. See the
`wx.lib.inspection documentation
<https://docs.wxpython.org/wx.lib.inspection.html>`_.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:class:`wx.lib.mixins.inspection.InspectableApp` is a drop-in
replacement for :class:`wx.App` that opens an inspection window
letting you browse the live widget and sizer tree. It is a useful
debugging aid when embedding Matplotlib in wxPython. See the
`wx.lib.inspection documentation
<https://docs.wxpython.org/wx.lib.inspection.html>`_.
As a development and debugging aid, you can replace :class:`wx.App`
by :class:`wx.lib.mixins.inspection.InspectableApp`.
This adds the capability to start the `Widget Inspection Tool
<https://wiki.wxpython.org/How%20to%20use%20Widget%20Inspection%20Tool%20-%20WIT%20%28Phoenix%29>`_ via :kbd:`Ctrl-Alt-I`.

Note: if you want to cross-reference the wx classes, you have to add the respective intersphinx_mapping. Alternatively, turn them into literals.

"""

import wx
import wx.lib.agw.aui as aui
import wx.lib.mixins.inspection as wit

from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wxagg import \
Expand Down Expand Up @@ -44,11 +51,7 @@ def add(self, name="plot"):


def demo():
# Alternatively you could use:
# app = wx.App()
# InspectableApp is a great debug tool, see:
# http://wiki.wxpython.org/Widget%20Inspection%20Tool
app = wit.InspectableApp()
app = wx.App()
frame = wx.Frame(None, -1, 'Plotter')
plotter = PlotNotebook(frame)
axes1 = plotter.add('figure 1').add_subplot()
Expand Down
Loading