.. 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.CursorBundle: ========================================================================================================================================== |phoenix_title| **wx.CursorBundle** ========================================================================================================================================== A cursor bundle is a set of different versions of the same cursor at different sizes. This class relationship with :ref:`wx.Cursor` is similar to that of :ref:`wx.BitmapBundle` with :ref:`wx.Bitmap`, but it has a simpler interface because cursors are never scaled and always use the closest available size. It is typically used like the following: Please see :ref:`wx.BitmapBundle` documentation for more information about different ways of creating it. .. versionadded:: 4.3/wxWidgets-3.3.0 | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class CursorBundle:
| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.CursorBundle.__init__` Default constructor constructs an empty bundle. :meth:`~wx.CursorBundle.Clear` Clear the bundle contents. :meth:`~wx.CursorBundle.GetCursorFor` Get the cursor of the size suitable for the given window. :meth:`~wx.CursorBundle.GetCursorForMainWindow` Get the cursor of the default size. :meth:`~wx.CursorBundle.IsOk` Check if cursor bundle is non-empty. :meth:`~wx.CursorBundle.IsSameAs` Check if two objects refer to the same bundle. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~wx.CursorBundle.CursorForMainWindow` See :meth:`~wx.CursorBundle.GetCursorForMainWindow` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: wx.CursorBundle(object) **Possible constructors**:: CursorBundle() -> None CursorBundle(bitmaps, hotSpot) -> None CursorBundle(bitmaps, hotSpotX=0, hotSpotY=0) -> None CursorBundle(other) -> None A cursor bundle is a set of different versions of the same cursor at different sizes. .. method:: __init__(self, *args, **kw) |overload| **Overloaded Implementations:** :html:`

` **__init__** `(self)` Default constructor constructs an empty bundle. Such bundle represents the absence of any custom cursor but not an empty cursor (``CURSOR_BLANK`` can be used if this is really needed). You can use the assignment operator to set the bundle contents later. :rtype: `None` :html:`

` **__init__** `(self, bitmaps, hotSpot)` Create a cursor bundle from the given bitmap bundle. :param `bitmaps`: The bitmap bundle to use for the cursor, typically containing bitmap in at least two sizes. :type `bitmaps`: wx.BitmapBundle :param `hotSpot`: Hotspot coordinates (relative to the top left of the image). The coordinates are relative to the default size of the bitmap bundle and are scaled by wxWidgets for other sizes. :type `hotSpot`: wx.Point :rtype: `None` :html:`

` **__init__** `(self, bitmaps, hotSpotX=0, hotSpotY=0)` This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. :param `bitmaps`: :type `bitmaps`: wx.BitmapBundle :param `hotSpotX`: :type `hotSpotX`: int :param `hotSpotY`: :type `hotSpotY`: int :rtype: `None` :html:`

` **__init__** `(self, other)` Copy constructor performs a shallow copy of the bundle. This operation is cheap as it doesn't copy any bitmaps. :param `other`: :type `other`: wx.CursorBundle :rtype: `None` :html:`

` .. method:: Clear(self) Clear the bundle contents. :meth:`IsOk` will return ``False`` after doing this. Use the assignment operator to set the bundle contents later. :rtype: `None` .. method:: GetCursorFor(self, window) Get the cursor of the size suitable for the given window. :param `window`: :type `window`: wx.Window :rtype: :ref:`wx.Cursor` .. method:: GetCursorForMainWindow(self) Get the cursor of the default size. Prefer to use :meth:`GetCursorFor` instead if there is a suitable window available, this function only exists as last resort. :rtype: :ref:`wx.Cursor` .. method:: IsOk(self) Check if cursor bundle is non-empty. :rtype: `bool` .. method:: IsSameAs(self, other) Check if two objects refer to the same bundle. Note that this compares the object identity, i.e. this function returns ``True`` only for copies of the same bundle, but ``False`` for two bundles created from the same bitmap bundle and same hotspot coordinates. :param `other`: :type `other`: wx.CursorBundle :rtype: `bool` .. attribute:: CursorForMainWindow See :meth:`~wx.CursorBundle.GetCursorForMainWindow`