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

.. currentmodule:: wx.lib.throbber

.. highlight:: python



.. _wx.lib.throbber.Throbber:

==========================================================================================================================================
|phoenix_title|  **wx.lib.throbber.Throbber**
==========================================================================================================================================

The first argument is either the name of a file that will be split into frames
(a composite image) or a list of  strings of image names that will be treated
as individual frames.  If a single (composite) image is given, then additional
information must be provided: the number of frames in the image and the width
of each frame.  The first frame is treated as the "at rest" frame (it is not
shown during animation, but only when Throbber.Rest() is called.
A second, single image may be optionally specified to overlay on top of the
animation. A label may also be specified to show on top of the animation.



|

|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>Throbber</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.lib.throbber.Throbber_inheritance.png" alt="Inheritance diagram of Throbber" 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="node2" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="57,83,168,112"/> <area shape="rect" id="node4" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="53,160,173,189"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="131,5,212,35"/> <area shape="rect" id="node7" href="wx.Window.html" title="wx.Window" alt="" coords="69,237,157,267"/> <area shape="rect" id="node5" href="wx.lib.throbber.Throbber.html" title="wx.lib.throbber.Throbber" alt="" coords="26,392,200,421"/> <area shape="rect" id="node6" href="wx.Panel.html" title="wx.Panel" alt="" coords="75,315,151,344"/> </map> 
   </p>

|


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

:class:`wx.Panel`

|


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

================================================================================ ================================================================================
:meth:`~wx.lib.throbber.Throbber.__init__`                                       Default class constructor.
:meth:`~wx.lib.throbber.Throbber.Decrement`                                      Display previous image in sequence.
:meth:`~wx.lib.throbber.Throbber.DoGetBestSize`                                  Get the best size of the widget.
:meth:`~wx.lib.throbber.Throbber.Draw`                                           Draw the widget.
:meth:`~wx.lib.throbber.Throbber.Increment`                                      Display next image in sequence.
:meth:`~wx.lib.throbber.Throbber.Next`                                           Display next image in sequence according to direction.
:meth:`~wx.lib.throbber.Throbber.OnDestroyWindow`                                Handles the ``wx.EVT_WINDOW_DESTROY`` event for :class:`Throbber`.
:meth:`~wx.lib.throbber.Throbber.OnPaint`                                        Handles the ``wx.EVT_PAINT`` event for :class:`Throbber`.
:meth:`~wx.lib.throbber.Throbber.OnTimer`                                        Handles the ``wx.EVT_TIMER`` event for :class:`Throbber`.
:meth:`~wx.lib.throbber.Throbber.Previous`                                       Display previous image in sequence according to direction.
:meth:`~wx.lib.throbber.Throbber.Rest`                                           Stop the animation and return to frame 0.
:meth:`~wx.lib.throbber.Throbber.Reverse`                                        Change the direction of the animation.
:meth:`~wx.lib.throbber.Throbber.Running`                                        Returns ``True`` if the animation is running.
:meth:`~wx.lib.throbber.Throbber.SetCurrent`                                     Set current image.
:meth:`~wx.lib.throbber.Throbber.SetFont`                                        Set the font for the label.
:meth:`~wx.lib.throbber.Throbber.SetFrameDelay`                                  Delay between each frame.
:meth:`~wx.lib.throbber.Throbber.SetLabel`                                       Change the text of the label.
:meth:`~wx.lib.throbber.Throbber.SetRest`                                        Set rest image.
:meth:`~wx.lib.throbber.Throbber.SetSequence`                                    Order to display images in.
:meth:`~wx.lib.throbber.Throbber.Start`                                          Start the animation.
:meth:`~wx.lib.throbber.Throbber.Stop`                                           Stop the animation.
:meth:`~wx.lib.throbber.Throbber.ToggleLabel`                                    Toggle the label.
:meth:`~wx.lib.throbber.Throbber.ToggleOverlay`                                  Toggle the overlay image.
:meth:`~wx.lib.throbber.Throbber.Update`                                         Handles the ``EVT_UPDATE_THROBBER`` event for :class:`ResizeWidget`.
:meth:`~wx.lib.throbber.Throbber.Wrap`                                           Wrap the throbber around.
================================================================================ ================================================================================


|


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


.. class:: Throbber(wx.Panel)

   The first argument is either the name of a file that will be split into frames
   (a composite image) or a list of  strings of image names that will be treated
   as individual frames.  If a single (composite) image is given, then additional
   information must be provided: the number of frames in the image and the width
   of each frame.  The first frame is treated as the "at rest" frame (it is not
   shown during animation, but only when Throbber.Rest() is called.
   A second, single image may be optionally specified to overlay on top of the
   animation. A label may also be specified to show on top of the animation.

   .. method:: __init__(self, parent, id, bitmap, pos = wx.DefaultPosition, size = wx.DefaultSize, frameDelay = 0.1, frames = 0, frameWidth = 0, label = None, overlay = None, reverse = 0, style = 0, name = "throbber", rest = 0, current = 0, direction = 1, sequence = None )

      Default class constructor.
      
      :param `parent`: parent window, must not be ``None``
      :param integer `id`: window identifier. A value of -1 indicates a default value
      :param `bitmap`: a :class:`wx.Bitmap` to be used
      :param `pos`: the control position. A value of (-1, -1) indicates a default position,
       chosen by either the windowing system or wxPython, depending on platform
      :param `size`: the control size. A value of (-1, -1) indicates a default size,
       chosen by either the windowing system or wxPython, depending on platform
      :param `frameDelay`: time delay between frames
      :param `frames`: number of frames (only necessary for composite image)
      :param `frameWidth`: width of each frame (only necessary for composite image)
      :param string `label`: optional text to be displayed
      :param `overlay`: optional :class:`wx.Bitmap` to overlay on animation
      :param boolean `reverse`: reverse direction at end of animation
      :param integer `style`: the underlying :class:`wx.Control` style
      :param string `name`: the widget name.
      :param `rest`: the rest frame
      :param `current`: the current frame
      :param `direction`: 1 advances = -1 reverses
      :param `sequence`: sequence of frames, defaults to range(self.frames)


   .. method:: Decrement(self)

      Display previous image in sequence.


   .. method:: DoGetBestSize(self)

      Get the best size of the widget.
      
      :returns: the width and height


   .. method:: Draw(self, dc)

      Draw the widget.
      
      :param `dc`: the :class:`wx.DC` to draw on


   .. method:: Increment(self)

      Display next image in sequence.


   .. method:: Next(self)

      Display next image in sequence according to direction.


   .. method:: OnDestroyWindow(self, event)

      Handles the ``wx.EVT_WINDOW_DESTROY`` event for :class:`Throbber`.
      
      :param `event`: a :class:`wx.WindowDestroyEvent` event to be processed.


   .. method:: OnPaint(self, event)

      Handles the ``wx.EVT_PAINT`` event for :class:`Throbber`.
      
      :param `event`: a :class:`PaintEvent` event to be processed.


   .. method:: OnTimer(self, event)

      Handles the ``wx.EVT_TIMER`` event for :class:`Throbber`.
      
      :param `event`: a :class:`TimerEvent` event to be processed.


   .. method:: Previous(self)

      Display previous image in sequence according to direction.


   .. method:: Rest(self)

      Stop the animation and return to frame 0.


   .. method:: Reverse(self)

      Change the direction of the animation.


   .. method:: Running(self)

      Returns ``True`` if the animation is running.


   .. method:: SetCurrent(self, current)

      Set current image.
      
      :param int `current`: the index to the current image


   .. method:: SetFont(self, font)

      Set the font for the label.
      
      :param `font`: the :class:`wx.Font` to use


   .. method:: SetFrameDelay(self, frameDelay = 0.05)

      Delay between each frame.
      
      :param float `frameDelay`: the delay between frames.


   .. method:: SetLabel(self, label)

      Change the text of the label.
      
      :param string `label`: the label text.


   .. method:: SetRest(self, rest)

      Set rest image.
      
      :param int `rest`: the index for the rest frame.


   .. method:: SetSequence(self, sequence = None)

      Order to display images in.
      
      :param `sequence`: a sequence containing the order to display images in.


   .. method:: Start(self)

      Start the animation.


   .. method:: Stop(self)

      Stop the animation.


   .. method:: ToggleLabel(self, state = None)

      Toggle the label.
      
      :param boolean `state`: set the label state or if None toggle state.


   .. method:: ToggleOverlay(self, state = None)

      Toggle the overlay image.
      
      :param boolean `state`: set the overlay state or if None toggle state.


   .. method:: Update(self, event)

      Handles the ``EVT_UPDATE_THROBBER`` event for :class:`ResizeWidget`.
      
      :param `event`: a :class:`UpdateThrobberEvent` event to be processed.


   .. method:: Wrap(self)

      Wrap the throbber around.


