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¶
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¶
- 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.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self)
Default constructor constructs an empty bundle.
Such bundle represents the absence of any custom cursor but not an empty cursor (
CURSOR_BLANKcan be used if this is really needed).You can use the assignment operator to set the bundle contents later.
- Return type:
None
__init__ (self, bitmaps, hotSpot)
Create a cursor bundle from the given bitmap bundle.
- Parameters:
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.
- Return type:
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.
- Parameters:
bitmaps (wx.BitmapBundle)
hotSpotX (int)
hotSpotY (int)
- Return type:
None
__init__ (self, other)
Copy constructor performs a shallow copy of the bundle.
This operation is cheap as it doesn’t copy any bitmaps.
- Parameters:
other (wx.CursorBundle)
- Return type:
None
- Clear(self)¶
Clear the bundle contents.
IsOkwill returnFalseafter doing this.Use the assignment operator to set the bundle contents later.
- Return type:
None
- GetCursorFor(self, window)¶
Get the cursor of the size suitable for the given window.
- GetCursorForMainWindow(self)¶
Get the cursor of the default size.
Prefer to use
GetCursorForinstead if there is a suitable window available, this function only exists as last resort.- Return type:
- IsOk(self)¶
Check if cursor bundle is non-empty.
- Return type:
bool
- IsSameAs(self, other)¶
Check if two objects refer to the same bundle.
Note that this compares the object identity, i.e. this function returns
Trueonly for copies of the same bundle, butFalsefor two bundles created from the same bitmap bundle and same hotspot coordinates.- Parameters:
other (wx.CursorBundle)
- Return type:
bool
Properties¶
- CursorForMainWindow¶
