.. wxPython Phoenix documentation

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

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

.. include:: headings.inc



.. _wx.FontDialog:

==========================================================================================================================================
|phoenix_title|  **wx.FontDialog**
==========================================================================================================================================

This class represents the font chooser dialog.          





         



.. seealso:: :ref:`FontDialog Overview <fontdialog overview>`, :ref:`wx.FontData`, :ref:`wx.GetFontFromUser`    







|

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

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>FontDialog</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.FontDialog_inheritance.png" alt="Inheritance diagram of FontDialog" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.FontDialog.html" title="wx.FontDialog" alt="" coords="51,469,166,499"/> <area shape="rect" id="node2" href="wx.Dialog.html" title="wx.Dialog" alt="" coords="65,392,152,421"/> <area shape="rect" id="node3" href="wx.TopLevelWindow.html" title="wx.TopLevelWindow" alt="" coords="31,315,186,344"/> <area shape="rect" id="node4" href="wx.NonOwnedWindow.html" title="wx.NonOwnedWindow" alt="" coords="25,237,193,267"/> <area shape="rect" id="node5" href="wx.Window.html" title="wx.Window" alt="" coords="60,160,157,189"/> <area shape="rect" id="node6" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="50,83,167,112"/> <area shape="rect" id="node7" href="wx.Object.html" title="wx.Object" alt="" coords="5,5,92,35"/> <area shape="rect" id="node8" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="117,5,223,35"/> </map> 
   </p>
   </div>

|


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

================================================================================ ================================================================================
:meth:`~wx.FontDialog.__init__`                                                  Default constructor.
:meth:`~wx.FontDialog.Create`                                                    Creates the dialog if the :ref:`wx.FontDialog`  object had been initialized using the default constructor.
:meth:`~wx.FontDialog.GetClassDefaultAttributes`                                 
:meth:`~wx.FontDialog.GetFontData`                                               Returns the :ref:`font data <wx.FontData>`  associated with the font dialog.
:meth:`~wx.FontDialog.ShowModal`                                                 Shows the dialog, returning  ``ID_OK``   if the user pressed Ok, and   ``ID_CANCEL``   otherwise.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.FontDialog.FontData`                                                  See :meth:`~wx.FontDialog.GetFontData`
================================================================================ ================================================================================


|


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


.. class:: wx.FontDialog(Dialog)

   **Possible constructors**::

       FontDialog()
       
       FontDialog(parent)
       
       FontDialog(parent, data)
       
   
   This class represents the font chooser dialog.



   .. method:: __init__(self, *args, **kw)



      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self)`
      
      Default constructor.                  
      
      :meth:`Create`   must be called before the dialog can be shown.                   
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, parent)`
      
      Constructor with parent window.                  
      
      
      :param `parent`: 
      :type `parent`: wx.Window
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **__init__** `(self, parent, data)`
      
      Constructor.                  
      
      Pass a parent window, and the :ref:`font data <wx.FontData>`  object to be used to initialize the dialog controls.                  
      
      
      :param `parent`: 
      :type `parent`: wx.Window
      :param `data`: 
      :type `data`: wx.FontData
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: Create(self, *args, **kw)

      Creates the dialog if the :ref:`wx.FontDialog`  object had been initialized using the default constructor.                  

                 



      :returns: 

         ``True`` on success and ``False`` if an error occurred.   





      |overload| Overloaded Implementations:

      :html:`<hr class="overloadsep" /><br />`

      
      **Create** `(self, parent)`
      
      
      
      
      :param `parent`: 
      :type `parent`: wx.Window
      
      
      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **Create** `(self, parent, data)`
      
      
      
      
      :param `parent`: 
      :type `parent`: wx.Window
      :param `data`: 
      :type `data`: wx.FontData
      
      
      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. staticmethod:: GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL)




      :param `variant`: 
      :type `variant`: wx.WindowVariant




      :rtype: :ref:`wx.VisualAttributes`








   .. method:: GetFontData(self)

      Returns the :ref:`font data <wx.FontData>`  associated with the font dialog.                  

      :rtype: :ref:`wx.FontData`








   .. method:: ShowModal(self)

      Shows the dialog, returning  ``ID_OK``   if the user pressed Ok, and   ``ID_CANCEL``   otherwise.                   

      If the user cancels the dialog (ShowModal returns  ``ID_CANCEL`` ), no font will be created. If the user presses ``wx.OK``, a new  :ref:`wx.Font`  will be created and stored in the font dialog's :ref:`wx.FontData`  structure. 

                

      :rtype: `int`







      .. seealso:: :meth:`GetFontData`     








   .. attribute:: FontData

      See :meth:`~wx.FontDialog.GetFontData`

