wxCaret(3)
๐ wxCaret โ the vibes-based guide ๐
okay bestie, welcome to the Erlang Module Definition for wxCaret, aka the โจblinking cursorโจ module. grab a strawberry ๐ and let's get into it.
๐ NAME ๐
wxCaret โ a caret is a blinking cursor showing the position where the typed text will appear. literally the little blinky line that tells you where your letters are about to land ๐
๐ธ DESCRIPTION ๐ธ
okay so, text controls usually have their own caret, right? but wxCaret provides a way to use a caret in other windows. main character energy for every window, not just the text ones ๐
Currently, the caret appears as a rectangle of the given size. In the future, it will be possible to specify a bitmap to be used for the caret shape. so rn it's giving "rectangle realness" and future-us gets bitmaps ๐ฆ
A caret is always associated with a window, and the current caret can be retrieved using wxWindow:getCaret/1. The same caret can't be reused in two different windows. no cap, it's one caret per situationship, do not try to share ๐ซ
wxWidgets docs: wxCaret
โจ DATA TYPES โจ
wxCaret()::wx:wx_object(). yep that's the whole vibe, it's a wx object ๐ซถ
๐ FUNCTIONS ๐
create(This, Window, Size) -> boolean()
when
This :: wxCaret(),
Window :: wxWindow:wxWindow(),
Size :: {W :: integer(), H :: integer()}.
create(This, Window, Width, Height) -> boolean()
when
This :: wxCaret(),
Window :: wxWindow:wxWindow(),
Width :: integer(),
Height :: integer().
Creates a caret with the given size (in pixels) and associates it with the window (same as the equivalent constructors). it's giving constructor energy but make it a function call ๐ซ
destroy(This :: wxCaret()) -> ok.
Destroys the object. rip bozo ๐ญ it's gone, clean up after yourself bestie.
getBlinkTime() -> integer().
Returns the blink time, which is measured in milliseconds and is the time elapsed between 2 inversions of the caret. the blink time of the caret is the same for all carets, so this function is static โ one blink setting to rule them all ๐ no per-caret customization here, it's communal.
getPosition(This) -> {X :: integer(), Y :: integer()}
when This :: wxCaret().
getSize(This) -> {W :: integer(), H :: integer()}
when This :: wxCaret().
getWindow(This) -> wxWindow:wxWindow() when This :: wxCaret().
Get the window the caret is associated with. it's giving "who's your window bestie" ๐ช
hide(This) -> ok when This :: wxCaret().
Hides the caret, same as Show(false). same thing, different spelling, periodt.
isOk(This) -> boolean() when This :: wxCaret().
Returns true if the caret was created successfully. vibe check passed โ
isVisible(This) -> boolean() when This :: wxCaret().
Returns true if the caret is visible and false if it is permanently hidden โ but heads up, if it's blinking and not shown currently but will be after the next blink, this method still returns true. so like. it's not lying, it's just mid-blink ๐
move(This, Pt) -> ok
when
This :: wxCaret(),
Pt :: {X :: integer(), Y :: integer()}.
move(This, X, Y) -> ok
when This :: wxCaret(), X :: integer(), Y :: integer().
Move the caret to given position (in logical coordinates). scoot scoot ๐ผ
new(Window, Size) -> wxCaret()
when
Window :: wxWindow:wxWindow(),
Size :: {W :: integer(), H :: integer()}.
new(Window, Width, Height) -> wxCaret()
when
Window :: wxWindow:wxWindow(),
Width :: integer(),
Height :: integer().
Creates a caret with the given size (in pixels) and associates it with the window. fresh caret, fresh start, iconic behavior โจ
setBlinkTime(Milliseconds) -> ok when Milliseconds :: integer().
Sets the blink time for all the carets. all of them. every single one. ๐ซ
โ ๏ธ Warning: Under Windows, this function will change the blink time for all carets permanently (until the next time it is called), even for carets in other applications. not just your app bestie, it's everyone's blinking now ๐
See: getBlinkTime/0
setSize(This, Size) -> ok
when
This :: wxCaret(),
Size :: {W :: integer(), H :: integer()}.
setSize(This, Width, Height) -> ok
when
This :: wxCaret(),
Width :: integer(),
Height :: integer().
Changes the size of the caret. glow-up size, new era, new rectangle ๐
show(This, [Option]) -> ok
when This :: wxCaret(), Option :: {show, boolean()}.
Shows or hides the caret.
Notice that if the caret was hidden N times, it must be shown N times as well to reappear on the screen. yes fr fr โ it's counting ๐งฎ hide it 3 times, show it 3 times, otherwise it stays ghosting you ๐
that's the whole module bestie, every function, every type, every warning, nothing skipped, no cap ๐ซถ๐
<tulip>this lil tour came to you from Ericsson AB, covering wx 2.6 โ go forth and blink responsibly โจ๐
</tulip>
๐ฆ 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