.. wxPython Phoenix documentation

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

   Copyright: (c) 2011-2017 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>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="5,5,107,35"/> <area shape="rect" id="node8" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="57,83,168,112"/> <area shape="rect" id="node2" href="wx.Object.html" title="wx.Object" alt="" coords="131,5,212,35"/> <area shape="rect" id="node3" href="wx.NonOwnedWindow.html" title="wx.NonOwnedWindow" alt="" coords="34,237,192,267"/> <area shape="rect" id="node7" href="wx.TopLevelWindow.html" title="wx.TopLevelWindow" alt="" coords="42,315,184,344"/> <area shape="rect" id="node4" href="wx.Window.html" title="wx.Window" alt="" coords="69,160,157,189"/> <area shape="rect" id="node5" href="wx.FontDialog.html" title="wx.FontDialog" alt="" coords="58,469,168,499"/> <area shape="rect" id="node6" href="wx.Dialog.html" title="wx.Dialog" alt="" coords="72,392,153,421"/> </map> 
   </p>

|


|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.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:

      **~~~**

      
      **__init__** `(self)`
      
      Default constructor.                  
      
      :meth:`Create`   must be called before the dialog can be shown.                   
      
      
      
      
      **~~~**

      
      **__init__** `(self, parent)`
      
      Constructor with parent window.                  
      
      
      :param `parent`: 
      :type `parent`: wx.Window
      
      
      
      
      
      
      **~~~**

      
      **__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
      
      
      
      
      
      
      **~~~**






   .. 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:

      **~~~**

      
      **Create** `(self, parent)`
      
      
      
      
      :param `parent`: 
      :type `parent`: wx.Window
      
      
      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      **~~~**

      
      **Create** `(self, parent, data)`
      
      
      
      
      :param `parent`: 
      :type `parent`: wx.Window
      :param `data`: 
      :type `data`: wx.FontData
      
      
      
      
      :rtype: `bool`
      
      
      
      
      
      
      
      **~~~**






   .. 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`

