wx.CursorBundle¶A cursor bundle is a set of different versions of the same cursor at different sizes.
This class relationship with wx.Cursor is similar to that of wx.BitmapBundle with 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 wx.BitmapBundle documentation for more information about different ways of creating it.
Added in version 4.3/wxWidgets-3.3.0.
Class Hierarchy¶
Inheritance diagram for class CursorBundle:
Methods Summary¶Default constructor constructs an empty bundle. |
|
Clear the bundle contents. |
|
Get the cursor of the size suitable for the given window. |
|
Get the cursor of the default size. |
|
Check if cursor bundle is non-empty. |
|
Check if two objects refer to the same bundle. |
Properties Summary¶
Class API¶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.
__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.
None
__init__ (self, bitmaps, hotSpot)
Create a cursor bundle from the given bitmap bundle.
bitmaps (wx.BitmapBundle) – The bitmap bundle to use for the cursor, typically containing bitmap in at least two sizes.
hotSpot (wx.Point) – 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.
None
__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.
bitmaps (wx.BitmapBundle)
hotSpotX (int)
hotSpotY (int)
None
__init__ (self, other)
Copy constructor performs a shallow copy of the bundle.
This operation is cheap as it doesn’t copy any bitmaps.
other (wx.CursorBundle)
None
Clear the bundle contents.
IsOk will return False after doing this.
Use the assignment operator to set the bundle contents later.
None
Get the cursor of the size suitable for the given window.
Get the cursor of the default size.
Prefer to use GetCursorFor instead if there is a suitable window available, this function only exists as last resort.
Check if cursor bundle is non-empty.
bool
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.
other (wx.CursorBundle)
bool