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



.. _wx.html2.WebViewFactory:

==========================================================================================================================================
|phoenix_title|  **wx.html2.WebViewFactory**
==========================================================================================================================================

An abstract factory class for creating :ref:`wx.html2.WebView`  backends. 
         

Each implementation of :ref:`wx.html2.WebView`  should have its own factory. 

:ref:`wx.html2.WebView` 




         



.. versionadded:: 2.9.5 
     







.. seealso:: :ref:`wx.html2.WebView`    







|

|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>WebViewFactory</strong>:</label>
      <div class="collapsible-content">
         <p class="graphviz">
            <center><img src="_static/images/inheritance/wx.html2.WebViewFactory_inheritance.svg" alt="Inheritance diagram of WebViewFactory" usemap="#dummy" class="inheritance invert-in-dark-mode"/></center>
            <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.html2.WebViewFactory.html" title="An abstract factory class for creating wx.html2.WebView  backends." alt="" coords="5,82,222,111"/> <area shape="rect" id="node2" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="64,5,163,34"/> </map> 
         </p>
      </div>
   </div>
   <script type="text/javascript" src="_static/inheritancetoggle.js"></script>



|


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

================================================================================ ================================================================================
:meth:`~wx.html2.WebViewFactory.Create`                                          Function to create a new :ref:`wx.html2.WebView`  with two-step creation, :meth:`wx.html2.WebView.Create`   should be called on the returned object.
:meth:`~wx.html2.WebViewFactory.CreateConfiguration`                             Create a :ref:`wx.html2.WebViewConfiguration`  object for :ref:`wx.html2.WebView`  instances created by this factory.
:meth:`~wx.html2.WebViewFactory.CreateWithConfig`                                Function to create a new :ref:`wx.html2.WebView`  with two-step creation with a :ref:`wx.html2.WebViewConfiguration`, :meth:`wx.html2.WebView.Create`   should be called on the returned object.
:meth:`~wx.html2.WebViewFactory.IsAvailable`                                     Function to check if the backend is available at runtime.
================================================================================ ================================================================================


|


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


.. class:: wx.html2.WebViewFactory(Object)

   An abstract factory class for creating WebView backends.



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



      |overload| **Overloaded Implementations:**

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

      
      **Create** `(self)`
      
      Function to create a new :ref:`wx.html2.WebView`  with two-step creation, :meth:`wx.html2.WebView.Create`   should be called on the returned object. 
                       
      
      
                      
      
      :rtype: :ref:`wx.html2.WebView`
      
      
      
      
      
      
      
      :returns: 
      
         The created :ref:`wx.html2.WebView`.   
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`

      
      **Create** `(self, parent, id, url=WebViewDefaultURLStr, pos=DefaultPosition, size=DefaultSize, style=0, name=WebViewNameStr)`
      
      Function to create a new :ref:`wx.html2.WebView`  with parameters. 
                       
      
      
      
      
      :param `parent`: Parent window for the control   
      :type `parent`: wx.Window
      :param `id`: ``ID`` of this control   
      :type `id`: wx.WindowID
      :param `url`: Initial URL to load   
      :type `url`: string
      :param `pos`: Position of the control   
      :type `pos`: wx.Point
      :param `size`: Size of the control   
      :type `size`: wx.Size
      :param `style`: Window style. For generic window styles, please see :ref:`wx.Window`.   
      :type `style`: long
      :param `name`: Window name   
      :type `name`: string
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      :rtype: :ref:`wx.html2.WebView`
      
      
      
      
                        
      
      
      
      :returns: 
      
         The created :ref:`wx.html2.WebView`    
      
      
      
      
      
      
      
      :html:`<hr class="overloadsep" /><br />`






   .. method:: CreateConfiguration(self)

      Create a :ref:`wx.html2.WebViewConfiguration`  object for :ref:`wx.html2.WebView`  instances created by this factory. 
                 


                

      :rtype: :ref:`wx.html2.WebViewConfiguration`







      .. versionadded:: 4.3/wxWidgets-3.3.0  
     








   .. method:: CreateWithConfig(self, config)

      Function to create a new :ref:`wx.html2.WebView`  with two-step creation with a :ref:`wx.html2.WebViewConfiguration`, :meth:`wx.html2.WebView.Create`   should be called on the returned object. 
                 


                


      :param `config`: 
      :type `config`: wx.html2.WebViewConfiguration




      :rtype: :ref:`wx.html2.WebView`







      :returns: 

         The created :ref:`wx.html2.WebView`.   







      .. versionadded:: 4.3/wxWidgets-3.3.0  
    







      .. seealso:: :meth:`CreateConfiguration`     








   .. method:: IsAvailable(self)

      Function to check if the backend is available at runtime. 
                 

      The :ref:`wx.html2.WebView`  implementation can use this function to check all runtime requirements without trying to create a :ref:`wx.html2.WebView`. 


                

      :rtype: `bool`







      :returns: 

         ``True`` if the backend can be used or ``False`` if it is not available during runtime.  







      .. versionadded:: 4.1/wxWidgets-3.1.5  
     







