.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" 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 .\" ======================================================================== .\" .IX Title "Tickit::Widget::Tabbed::Ribbon 3pm" .TH Tickit::Widget::Tabbed::Ribbon 3pm "2022-12-17" "perl v5.36.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::Widget::Tabbed::Ribbon" \- base class for "Tickit::Widget::Tabbed" control ribbon .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class contains the default implementation for the control ribbon used by Tickit::Widget::Tabbed, and also acts as a base class to assist in the creation of a custom ribbon. Details of this class and its operation are useful to know when implenting a custom control ribbon. .PP It is not necessary to consider this class if simply using the \&\f(CW\*(C`Tickit::Widget::Tabbed\*(C'\fR with its default control ribbon. .SH "CUSTOM RIBBON CLASS" .IX Header "CUSTOM RIBBON CLASS" To perform create a custom ribbon class, create a subclass of \&\f(CW\*(C`Tickit::Widget::Tabbed::Ribbon\*(C'\fR with a constructor having the following behaviour: .PP .Vb 2 \& package Custom::Ribbon::Class; \& use base qw( Tickit::Widget::Tabbed::Ribbon ); \& \& sub new_for_orientation \& { \& my $class = shift; \& my ( $orientation, %args ) = @_; \& \& ... \& \& return $self; \& } .Ve .PP Alternatively if this is not done, then one of two subclasses will be used for the constructor, by appending \f(CW\*(C`::horizontal\*(C'\fR or \f(CW\*(C`::vertical\*(C'\fR to the class name. In this case, the custom class should provide these as well. .PP .Vb 2 \& package Custom::Ribbon::Class; \& use base qw( Tickit::Widget::Tabbed::Ribbon ); \& \& package Custom::Ribbon::Class::horizontal; \& use base qw( Custom::Ribbon::Class ); \& \& ... \& \& package Custom::Ribbon::Class::vertical; \& use base qw( Custom::Ribbon::Class ); \& \& ... .Ve .PP Arrange for this class to be used by the tabbed widget either by passing its name as a constructor argument called \f(CW\*(C`ribbon_class\*(C'\fR, or by overriding a method called \f(CW\*(C`RIBBON_CLASS\*(C'\fR. .PP .Vb 3 \& my $tabbed = Tickit::Widget::Tabbed\->new( \& ribbon_class => "Ribbon::Class::Name" \& ); .Ve .PP or .PP .Vb 1 \& use constant RIBBON_CLASS => "Ribbon::Class::Name"; .Ve .SH "METHODS" .IX Header "METHODS" .SS "tabs" .IX Subsection "tabs" .Vb 1 \& @tabs = $ribbon\->tabs \& \& $count = $ribbon\->tabs .Ve .PP Returns a list of the contained Tickit::Widget::Tabbed tab objects in list context, or the count of them in scalar context. .SS "active_tab_index" .IX Subsection "active_tab_index" .Vb 1 \& $index = $ribbon\->active_tab_index .Ve .PP Returns the index of the currently-active tab .SS "active_tab" .IX Subsection "active_tab" .Vb 1 \& $tab = $ribbon\->active_tab .Ve .PP Returns the currently-active tab as a \f(CW\*(C`Tickit::Widget::Tabbed\*(C'\fR tab object. .SH "SUBCLASS METHODS" .IX Header "SUBCLASS METHODS" The subclass will need to provide implementations of the following methods. .SS "render" .IX Subsection "render" .Vb 1 \& $ribbon\->render( %args ) .Ve .SS "lines" .IX Subsection "lines" .Vb 1 \& $lines = $ribbon\->lines .Ve .SS "cols" .IX Subsection "cols" .Vb 1 \& $cols = $ribbon\->cols .Ve .PP As per the Tickit::Widget methods. .SS "on_key" .IX Subsection "on_key" .Vb 1 \& $handled = $ribbon\->on_key( $ev ) .Ve .SS "on_mouse" .IX Subsection "on_mouse" .Vb 1 \& $handled = $ribbon\->on_mouse( $ev ) .Ve .PP As per the Tickit::Widget methods. Optional. If not supplied then the ribbon will not respond to keyboard or mouse events. .SS "scroll_to_visible" .IX Subsection "scroll_to_visible" .Vb 1 \& $ribbon\->scroll_to_visible( $index ) .Ve .PP Requests that a scrollable control ribbon scrolls itself so that the given \&\f(CW$index\fR tab is visible. .SH "AUTHOR" .IX Header "AUTHOR" Paul Evans