wxCursor(3)
π NAME π
wxCursor β bestie, it's a lil bitmap that shows where ur mouse pointer is at, and the picture can hint at what a click is gonna do πβ¨
π¦ DESCRIPTION π¦
okay so, real talk: cursors in X and MS Windows get created in totally different ways. Same drama as icons, fr. So wxCursor makes separate cursors for each environment, and there are platform-specific methods for building a wxCursor object, which lowkey means you're probably gonna need conditional compilation (peep wxIcon for an example of that whole situation).
One single cursor object can serve a bunch of windows (any subwindow type, no gatekeeping π). The wxWidgets convention is to set the cursor for a window, like X does β not globally like MS Windows β though there's also a global wx_misc:setCursor/1 function available for MS Windows use, iykyk.
π Creating a Custom Cursor π
Here's an example of creating a cursor from 32x32 bitmap data (down_bits) plus a mask (down_mask), where for the bits 1 is black and 0 is white, and for the mask 1 is opaque and 0 is transparent. It works on Windows and GTK+, bestie β¨
Predefined objects (include wx.hrl), the way that they're just handed to you:
?wxNullCursorπ?wxSTANDARD_CURSORπ?wxHOURGLASS_CURSORβ?wxCROSS_CURSORπ
See:
wxBitmapwxIconwxWindow:setCursor/2wx_misc:setCursor/1?wxStockCursor
This class is derived, and can use functions, from:
wxBitmap
wxWidgets docs: wxCursor
πΈ DATA TYPES πΈ
wxCursor() :: wx:wx_object().β that's it, that's the whole type, periodt π
β¨ FUNCTIONS β¨
destroy(This :: wxCursor()) -> ok.β Destroys the object π bye bestie.isOk(This) -> boolean() when This :: wxCursor().β Returnstrueif cursor data is present. Vibe check on ur cursor fr fr.new() -> wxCursor().β Default constructor. The no-args classic πnew(CursorName) -> wxCursor()whenCursorName :: unicode:chardata();(Image) -> wxCursor()whenImage :: wxImage:wxImage() | wxCursor:wxCursor();(CursorId) -> wxCursor()whenCursorId :: wx:wx_enum().
Constructs a cursor using a cursor identifier π₯
new(CursorName, [Option]) -> wxCursor()when
CursorName :: unicode:chardata(),
Option ::
{type, wx:wx_enum()} |
{hotSpotX, integer()} |
{hotSpotY, integer()}.
Constructs a cursor by passing a string resource name or filename.
heads up bestie: the argumentshotSpotXandhotSpotYare only used when there's no hotspot info in the resource/image-file to load (e.g. when usingwxBITMAP_TYPE_ICOunder wxMSW orwxBITMAP_TYPE_XPMunder wxGTK) π
ok(This) -> boolean() when This :: wxCursor().β Equivalent to:isOk/1π
and that's the whole page, bestie π
tysm for reading, mwah π«Ά β this iconic lil manual came from Ericsson AB, version wx 2.6, and the page is literally named wxCursor(3). slay, bye β¨
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms