Tickit::Window - a window for drawing operations
Tickit::Window
Provides coordination of widget drawing activities. A Window represents a region of the screen that a widget occupies.
Window
Windows cannot directly be constructed. Instead they are obtained by sub-division of other windows, ultimately coming from the Tickit::RootWindow associated with the terminal.
Tickit::RootWindow
Obtain the size of the window
Change the size of the window.
Move the window relative to its parent.
A combination of resize and reposition, to atomically change all the coordinates of the window. Will only invoke on_geom_changed once, rather than twice as would be the case calling the above methods individually.
resize
reposition
on_geom_changed
Set the callback to invoke whenever the window is resized or repositioned; i.e. whenever its geometry changes.
$on_geom_changed->( $win )
Set the callback to invoke whenever a key is pressed while this window, or one of its child windows, has the input focus.
$handled = $on_key->( $win, $type, $str, $key )
The invoked code should return a true value if it considers the keypress dealt with, or false to pass it up to its parent window.
Returns the parent window; i.e. the window on which make_sub was called to create this one
make_sub
Returns the root window
Returns the Tickit::Term instance of the terminal on which this window lives.
Returns the coordinates of the start of the window, relative to the parent window.
Returns the coordinates of the start of the window, relative to the root window.
Returns the current Tickit::Pen object associated with this window
Replace the current Tickit::Pen object for this window with a new one. The object reference will be stored, allowing it to be shared with other objects. If undef is set, then a new, blank pen will be constructed.
undef
Returns a single attribue from the current pen
Retrieve the current pen settings for the window.
Returns the effective value of a pen attribute. This will be the value of this window's attribute if set, or the effective value of the attribute from its parent.
Retrieve the effective pen settings for the window. This will be the settings of the window and all its parents down to the root window, merged together.
Constructs a new sub-window starting at the given coordinates of this window. It will be sized to the given limits.
Moves the cursor to the given position within the window. Both $line and $col are 0-based.
$line
$col
Print the given text to the terminal at the current cursor position using the pen of the window.
Print the given text to the terminal at the current cursor position using the pen of the window, overridden by any extra attributes passed.
Erase $count columns forwards.
$count
Insert $count blank characters, moving subsequent ones to the right. Note this can only be achieved if the window extends all the way to the righthand edge of the terminal, or else the operation would corrupt further windows beyond it.
If this window does not extend to the righthand edge, then this method will simply return false. If it does, the characters are inserted and the method returns true.
Delete $count characters, moving subsequent ones to the left, and inserting blanks at the end of the line. Note this can only be achieved if the window extends all the way to the righthand edge of the terminal, or else the operation would corrupt further windows beyond it.
Attempt to scroll the contents of the window in the given direction. Most terminals cannot scroll arbitrary regions. If the terminal does not support the type of scrolling requested, this method returns false to indicate that the caller should instead redraw the required contents. If the scrolling was sucessful, the method returns true.
Put the cursor at the given position in this window. Ensures the cursor remains at this position after drawing.
Restore the state of the terminal to its idle state. Places the cursor back at the focus position, and restores the pen.
Erase the entire content of the window and reset it to the current background colour.
Paul Evans <leonerd@leonerd.org.uk>
To install Tickit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tickit
CPAN shell
perl -MCPAN -e shell install Tickit
For more information on module installation, please visit the detailed CPAN module installation guide.