.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2018 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc

.. module:: wx.lib.mixins.inspection

.. currentmodule:: wx.lib.mixins.inspection

.. highlight:: python



.. _wx.lib.mixins.inspection:

==========================================================================================================================================
|phoenix_title|  **wx.lib.mixins.inspection**
==========================================================================================================================================

This module provides the :class:`~lib.mixins.inspection.InspectableApp` and
:class:`~lib.mixins.inspection.InspectionMixin` which make it easy to use the Widget
Inspection Tool (WIT).


Description
===========

The Widget Inspection Tool (WIT) is very useful debugging tool provided with
wxPython, especially useful to debug layout issues when using :class:`wx.Sizer`.

The :class:`InspectableApp` is a "pre-mixed" :class:`App` and the
:class:`InspectionMixin` allows you to mix it with your custom :class:`App`
class.


Usage
=====

The following samples assume the default key sequence (*ctrl-alt-i*) to start
the WIT, additional information can be found on the following wiki page.

http://wiki.wxpython.org/Widget_Inspection_Tool

InspectableApp usage::

    import wx
    import wx.lib.sized_controls as sc
    import wx.lib.mixins.inspection as wit

    app = wit.InspectableApp()

    frame = sc.SizedFrame(None, -1, "WIT InspectableApp")

    pane = frame.GetContentsPane()
    pane.SetSizerType("horizontal")

    b1 = wx.Button(pane, wx.ID_ANY)
    t1 = wx.TextCtrl(pane, -1)
    t1.SetSizerProps(expand=True)

    frame.Show()

    app.MainLoop()


InspectionMixin usage::

    import wx
    import wx.lib.sized_controls as sc
    import wx.lib.mixins.inspection as wit

    class MyApp(wx.App, wit.InspectionMixin):
        def OnInit(self):
            self.Init()  # initialize the inspection tool
            return ``True`` 
    app = MyApp()

    frame = sc.SizedFrame(None, -1, "WIT InspectionMixin")

    pane = frame.GetContentsPane()
    pane.SetSizerType("horizontal")

    b1 = wx.Button(pane, wx.ID_ANY)
    t1 = wx.TextCtrl(pane, -1)
    t1.SetSizerProps(expand=True)

    frame.Show()

    app.MainLoop()


|class_summary| Classes Summary
===============================

================================================================================ ================================================================================
`~wx.lib.mixins.inspection.InspectableApp`                                       A simple mix of :class:`App` and :class:`InspectionMixin` that can be used
`~wx.lib.mixins.inspection.InspectionMixin`                                      This class is intended to be used as a mix-in with the :class:`App`.
================================================================================ ================================================================================


|


.. toctree::
   :maxdepth: 1
   :hidden:

   wx.lib.mixins.inspection.InspectableApp
   wx.lib.mixins.inspection.InspectionMixin