wxCaret(3)

๐Ÿ“ฆ
version 29.0.6 ยท 3 versions
, in ubuntu stonking

๐Ÿ’– 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