wx.Caret

Inheritance diagram for wx.Caret:



Description

A caret is a blinking cursor showing the position where the typed text will appear. The text controls usually have a caret but wx.Caret class also allows to use a caret in other windows.

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.

A caret is always associated with a window and the current caret can be retrieved using wx.Window.GetCaret. The same caret can’t be reused in two different windows.

Properties Summary

Class API

Methods

__init__(window, size)

Constructor.

Parameters:


Returns:

wx.Caret


Destroy()
Deletes the C++ object this Python object is a proxy for.

GetBlinkTime()

Returns the blink time which is measured in milliseconds and is the time elapsed between 2 inversions of the caret (blink time of the caret is the same for all carets, so this functions is static).


Returns:

int


GetPosition()

Get the caret position (in pixels).


Returns:

wx.Point


GetPositionTuple()

Get the caret position (in pixels).


Returns:

(x, y)


GetSize()

Get the caret size.


Returns:

wx.Size


GetSizeTuple()

Get the caret size.


Returns:

(width, height)


GetWindow()

Get the window the caret is associated with.


Returns:

wx.Window


Hide()
Same as Show.

IsOk()

Returns True if the caret was created successfully.


Returns:

bool


IsVisible()

Returns True if the caret is visible and False if it is permanently hidden (if it is is blinking and not shown currently but will be after the next blink, this method still returns True).


Returns:

bool


Move(pt)

Move the caret to given position (in logical coordinates).

Parameters:


MoveXY(x, y)

Move the caret to given position (in logical coordinates).

Parameters:

  • x (int)
  • y (int)

SetBlinkTime(milliseconds)

Sets the blink time for all the carets.

Parameters:

  • milliseconds (int)

Note

Under Windows, this function will change the blink time for all carets permanently (until the next time it is called), even for the carets in other applications.

See also

GetBlinkTime


SetSize(size)

Changes the size of the caret.

Parameters:

  • size (‘wx.Size <wx.Size.html>`_)

SetSizeWH(width, height)

Changes the size of the caret.

Parameters:

  • width (int)
  • height (int)

Show(show=True)

Shows or hides the caret.

Parameters:

  • show (bool)

Note

Notice that if the caret was hidden N times, it must be shown N times as well to reappear on the screen.


Properties

Position
See GetPosition
Size
See GetSize and SetSize
Window
See GetWindow