.. wxPython Phoenix documentation

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

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

.. include:: headings.inc

.. currentmodule:: wx.lib.combotreebox

.. highlight:: python



.. _wx.lib.combotreebox.MSWComboTreeBox:

==========================================================================================================================================
|phoenix_title|  **wx.lib.combotreebox.MSWComboTreeBox**
==========================================================================================================================================

MSWComboTreeBox adds one piece of functionality as compared to
NativeComboTreeBox: when the user browses through the tree, the
ComboTreeBox's text field is continuously updated to show the
currently selected item in the tree. If the user cancels
selecting a new item from the tree, e.g. by hitting escape, the
previous value (the one that was selected before the PopupFrame
was popped up) is restored.



|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div class="collabsible-wrapper">
      <input id="collapsible-inheritance" class="collapsible-checkbox" type="checkbox">
      <label for="collapsible-inheritance" tabindex="0" title="Show inheritance diagram" class="collapsible-label">Inheritance diagram for class <strong>MSWComboTreeBox</strong>:</label>
      <div class="collapsible-content">
         <p class="graphviz">
            <center><img src="_static/images/inheritance/wx.lib.combotreebox.MSWComboTreeBox_inheritance.svg" alt="Inheritance diagram of MSWComboTreeBox" usemap="#dummy" class="inheritance invert-in-dark-mode"/></center>
            <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.combotreebox.MSWComboTreeBox.html" title="MSWComboTreeBox adds one piece of functionality as compared to" alt="" coords="131,543,461,572"/> <area shape="rect" id="node2" href="wx.lib.combotreebox.NativeComboTreeBox.html" title="NativeComboTreeBox, and any subclass, uses the native ComboBox as basis," alt="" coords="128,466,464,495"/> <area shape="rect" id="node3" href="wx.lib.combotreebox.BaseComboTreeBox.html" title="BaseComboTreeBox is the base class for platform specific versions of the" alt="" coords="5,389,333,418"/> <area shape="rect" id="node4" href="wx.ComboBox.html" title="A combobox is like a combination of an edit control and a listbox." alt="" coords="358,389,490,418"/> <area shape="rect" id="node5" href="wx.Control.html" title="This is the base class for a control or 'widget'." alt="" coords="209,313,314,341"/> <area shape="rect" id="node6" href="wx.ItemContainer.html" title="This class is an abstract base class for some wxWidgets controls which contain several items such as wx.ListBox, wx.CheckListBox, wx.ComboBox  or wx.Choice." alt="" coords="348,313,500,341"/> <area shape="rect" id="node7" href="wx.TextEntry.html" title="Common base class for single line text entry fields." alt="" coords="524,313,643,341"/> <area shape="rect" id="node8" href="wx.Window.html" title="wx.Window  is the base class for all windows and represents any visible object on screen." alt="" coords="186,236,297,265"/> <area shape="rect" id="node9" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="167,159,315,188"/> <area shape="rect" id="node10" href="wx.EvtHandler.html" title="A class that can handle events from the windowing system." alt="" coords="175,82,308,111"/> <area shape="rect" id="node11" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="125,5,224,34"/> <area shape="rect" id="node12" href="wx.Trackable.html" title="Add-on base class for a trackable object." alt="" coords="248,5,371,34"/> <area shape="rect" id="node13" href="wx.ItemContainerImmutable.html" title="wx.ItemContainer  defines an interface which is implemented by all controls which have string subitems each of which may be selected." alt="" coords="321,236,548,265"/> </map> 
         </p>
      </div>
   </div>
   <script type="text/javascript" src="_static/inheritancetoggle.js"></script>



|


|super_classes| Known Superclasses
==================================

:class:`wx.lib.combotreebox.NativeComboTreeBox`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.lib.combotreebox.MSWComboTreeBox.NotifyNoItemSelected`                Restore the value copied previously, because the user has
:meth:`~wx.lib.combotreebox.MSWComboTreeBox.OnSelectionChangedInTree`            
:meth:`~wx.lib.combotreebox.MSWComboTreeBox.Popup`                               Extend Popup to store a copy of the current value, so we can
:meth:`~wx.lib.combotreebox.MSWComboTreeBox.SetValue`                            Extend SetValue to also select the text in the
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: MSWComboTreeBox(NativeComboTreeBox)

   MSWComboTreeBox adds one piece of functionality as compared to
   NativeComboTreeBox: when the user browses through the tree, the
   ComboTreeBox's text field is continuously updated to show the
   currently selected item in the tree. If the user cancels
   selecting a new item from the tree, e.g. by hitting escape, the
   previous value (the one that was selected before the PopupFrame
   was popped up) is restored.

   .. method:: NotifyNoItemSelected(self, \*args, \*\*kwargs)

      Restore the value copied previously, because the user has
      not selected a new value.


   .. method:: OnSelectionChangedInTree(self, event)


   .. method:: Popup(self, \*args, \*\*kwargs)

      Extend Popup to store a copy of the current value, so we can
      restore it later (in NotifyNoItemSelected). This is necessary
      because MSWComboTreeBox will change the value as the user
      browses through the items in the popped up tree.


   .. method:: SetValue(self, value)

      Extend SetValue to also select the text in the
      ComboTreeBox's text field.
      
      :param string `value`: set the value and select it


