.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Tickit 3pm" .TH Tickit 3pm "2018-11-01" "perl v5.28.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" "Tickit" \- Terminal Interface Construction KIT .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use Tickit; \& use Tickit::Widget::Box; \& use Tickit::Widget::Static; \& \& my $box = Tickit::Widget::Box\->new( \& h_border => 4, \& v_border => 2, \& bg => "green", \& child => Tickit::Widget::Static\->new( \& text => "Hello, world!", \& bg => "black", \& align => "centre", \& valign => "middle", \& ), \& ); \& \& Tickit\->new( root => $box )\->run; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`Tickit\*(C'\fR is a high-level toolkit for creating full-screen terminal-based interactive programs. It allows programs to be written in an abstracted way, working with a tree of widget objects, to represent the layout of the interface and implement its behaviours. .PP Its supported terminal features includes a rich set of rendering attributes (bold, underline, italic, 256\-colours, etc), support for mouse including wheel and position events above the 224th column and arbitrary modified key input via \fIlibtermkey\fR (all of these will require a supporting terminal as well). It also supports having multiple instances and non-blocking or asynchronous control. .PP At the current version, this is a Perl distribution which contains and \s-1XS\s0 and C implementation of the lower levels (Tickit::Term and Tickit::Pen), and implements the higher levels (Tickit::Window and Tickit::Widget) in pure perl. The \s-1XS\s0 parts are supported by \fIlibtickit\fR, either from the installed library, or using a bundled copy compiled at build time. It is intended that eventually the Window layer will be rewritten in \s-1XS\s0 and C instead. .SH "CONSTRUCTOR" .IX Header "CONSTRUCTOR" .SS "new" .IX Subsection "new" .Vb 1 \& $tickit = Tickit\->new( %args ) .Ve .PP Constructs a new \f(CW\*(C`Tickit\*(C'\fR framework container object. .PP Takes the following named arguments at construction time: .IP "term_in => \s-1IO\s0" 8 .IX Item "term_in => IO" \&\s-1IO\s0 handle for terminal input. Will default to \f(CW\*(C`STDIN\*(C'\fR. .IP "term_out => \s-1IO\s0" 8 .IX Item "term_out => IO" \&\s-1IO\s0 handle for terminal output. Will default to \f(CW\*(C`STDOUT\*(C'\fR. .IP "\s-1UTF8\s0 => \s-1BOOL\s0" 8 .IX Item "UTF8 => BOOL" If defined, overrides locale detection to enable or disable \s-1UTF\-8\s0 mode. If not defined then this will be detected from the locale by using Perl's \&\f(CW\*(C`${^UTF8LOCALE}\*(C'\fR variable. .IP "root => Tickit::Widget" 8 .IX Item "root => Tickit::Widget" If defined, sets the root widget using \f(CW\*(C`set_root_widget\*(C'\fR to the one specified. .IP "use_altscreen => \s-1BOOL\s0" 8 .IX Item "use_altscreen => BOOL" If defined but false, disables the use of altscreen, even if supported by the terminal. This will mean that the screen contents are stll available after the program has finished. .SH "METHODS" .IX Header "METHODS" .SS "later" .IX Subsection "later" .Vb 1 \& $tickit\->later( $code ) .Ve .PP Runs the given \s-1CODE\s0 reference at some time soon in the future. It will not be invoked yet, but will be invoked at some point before the next round of input events are processed. .SS "timer" .IX Subsection "timer" .Vb 1 \& $id = $tickit\->timer( at => $epoch, $code ) \& \& $id = $tickit\->timer( after => $delay, $code ) .Ve .PP Runs the given \s-1CODE\s0 reference at some fixed point in time in the future. The first argmuent must be either the string \f(CW\*(C`at\*(C'\fR, or \f(CW\*(C`after\*(C'\fR; and specifies that second argument gives either the absolute epoch time (\f(CW$epoch\fR), or the delay relative to now (\f(CW$delay\fR), respectively. Fractions are supported to a resolution of microseconds. .PP Returns an opaque integer value that may be passed to \*(L"cancel_timer\*(R". This value is safe to ignore if not required. .SS "cancel_timer" .IX Subsection "cancel_timer" .Vb 1 \& $tickit\->cancel_timer( $id ) .Ve .PP Removes a timer previously installed by \*(L"timer\*(R". After doing so the code will no longer be invoked. .SS "term" .IX Subsection "term" .Vb 1 \& $term = $tickit\->term .Ve .PP Returns the underlying Tickit::Term object. .SS "cols" .IX Subsection "cols" .SS "lines" .IX Subsection "lines" .Vb 1 \& $cols = $tickit\->cols \& \& $lines = $tickit\->lines .Ve .PP Query the current size of the terminal. Will be cached and updated on receipt of \f(CW\*(C`SIGWINCH\*(C'\fR signals. .SS "bind_key" .IX Subsection "bind_key" .Vb 1 \& $tickit\->bind_key( $key, $code ) .Ve .PP Installs a callback to invoke if the given key is pressed, overwriting any previous callback for the same key. The code block is invoked as .PP .Vb 1 \& $code\->( $tickit, $key ) .Ve .PP If \f(CW$code\fR is missing or \f(CW\*(C`undef\*(C'\fR, any existing callback is removed. .PP As a convenience for the common application use case, the \f(CW\*(C`Ctrl\-C\*(C'\fR key is bound to the \f(CW\*(C`stop\*(C'\fR method. .PP To remove this binding, simply bind another callback, or remove the binding entirely by setting \f(CW\*(C`undef\*(C'\fR. .SS "rootwin" .IX Subsection "rootwin" .Vb 1 \& $tickit\->rootwin .Ve .PP Returns the root Tickit::Window. .SS "set_root_widget" .IX Subsection "set_root_widget" .Vb 1 \& $tickit\->set_root_widget( $widget ) .Ve .PP Sets the root widget for the application's display. This must be a subclass of Tickit::Widget. .SS "setup_term" .IX Subsection "setup_term" .Vb 1 \& $tickit\->setup_term .Ve .PP Set up the screen and generally prepare to start running .SS "teardown_term" .IX Subsection "teardown_term" .Vb 1 \& $tickit\->teardown_term .Ve .PP Shut down the screen after running .SS "tick" .IX Subsection "tick" .Vb 1 \& $tickit\->tick .Ve .PP Run a single round of \s-1IO\s0 events. Does not call \f(CW\*(C`setup_term\*(C'\fR or \&\f(CW\*(C`teardown_term\*(C'\fR. .SS "run" .IX Subsection "run" .Vb 1 \& $tickit\->run .Ve .PP Calls the \f(CW\*(C`setup_term\*(C'\fR method, then processes \s-1IO\s0 events until stopped, by the \&\f(CW\*(C`stop\*(C'\fR method, \f(CW\*(C`SIGINT\*(C'\fR, \f(CW\*(C`SIGTERM\*(C'\fR or the \f(CW\*(C`Ctrl\-C\*(C'\fR key. Then runs the \&\f(CW\*(C`teardown_term\*(C'\fR method, and returns. .SS "stop" .IX Subsection "stop" .Vb 1 \& $tickit\->stop .Ve .PP Causes a currently-running \f(CW\*(C`run\*(C'\fR method to stop processing events and return. .SH "AUTHOR" .IX Header "AUTHOR" Paul Evans