.\" Automatically generated by Pod::Man 4.09 (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 .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Tickit::Widget::Tabbed 3pm" .TH Tickit::Widget::Tabbed 3pm "2018-07-29" "perl v5.26.2" "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 \- provide tabbed window support .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& use Tickit::Widget::Tabbed; \& my $tabbed = Tickit::Widget::Tabbed\->new; \& $tabbed\->add_tab(Tickit::Widget::Static\->new(text => \*(Aqsome text\*(Aq), label => \*(AqFirst tab\*(Aq); \& $tabbed\->add_tab(Tickit::Widget::Static\->new(text => \*(Aqsome text\*(Aq), label => \*(AqSecond tab\*(Aq); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Provides a container that operates as a tabbed window. .PP Subclass of Tickit::ContainerWidget. .SH "STYLE" .IX Header "STYLE" The default style pen is used as the widget pen. The following style pen prefixes are also used: .IP "ribbon => \s-1PEN\s0" 4 .IX Item "ribbon => PEN" The pen used for the ribbon .IP "active => \s-1PEN\s0" 4 .IX Item "active => PEN" The pen attributes used for the active tab on the ribbon .IP "more => \s-1PEN\s0" 4 .IX Item "more => PEN" The pen used for \*(L"more\*(R" ribbon scroll markers .PP The following style keys are used: .IP "more_left => \s-1STRING\s0" 4 .IX Item "more_left => STRING" .PD 0 .IP "more_right => \s-1STRING\s0" 4 .IX Item "more_right => STRING" .PD The text used to indicate that there is more content scrolled to the left or right, respectively, in the ribbon .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" Instantiate a new tabbed window. .PP Takes the following named parameters: .IP "\(bu" 4 tab_position \- (optional) location of the tabs, should be one of left, top, right, bottom. .SS "tab_position" .IX Subsection "tab_position" Accessor for the tab position (top, left, right, bottom). .SS "active_tab_index" .IX Subsection "active_tab_index" Returns the 0\-based index of the currently-active tab. .SS "active_tab" .IX Subsection "active_tab" Returns the currently-active tab as a tab object. See below. .SS "active_tab_widget" .IX Subsection "active_tab_widget" Returns the widget in the currently active tab. .SS "add_tab" .IX Subsection "add_tab" Add a new tab to this tabbed widget. Returns an object representing the tab; see \*(L"\s-1METHODS ON TAB OBJECTS\*(R"\s0 below. .PP First parameter is the widget to use. .PP Remaining form a hash: .IP "label \- label to show on the new tab" 4 .IX Item "label - label to show on the new tab" .SS "remove_tab" .IX Subsection "remove_tab" Remove tab given by 0\-based index or tab object. .SS "move_tab" .IX Subsection "move_tab" Move tab given by 0\-based index or tab object forward the given number of positions. .SS "activate_tab" .IX Subsection "activate_tab" Switch to the given tab; by 0\-based index, or object. .SS "next_tab" .IX Subsection "next_tab" Switch to the next tab. This may be bound as a key action. .SS "prev_tab" .IX Subsection "prev_tab" Switch to the previous tab. This may be bound as a key action. .SH "METHODS ON TAB OBJECTS" .IX Header "METHODS ON TAB OBJECTS" The following methods may be called on the objects returned by \f(CW\*(C`add_tab\*(C'\fR or \&\f(CW\*(C`active_tab\*(C'\fR. .SS "index" .IX Subsection "index" Returns the 0\-based index of this tab .SS "widget" .IX Subsection "widget" Returns the \f(CW\*(C`Tickit::Widget\*(C'\fR contained by this tab .SS "label" .IX Subsection "label" Returns the current label text .SS "set_label" .IX Subsection "set_label" Set new label text for the tab .SS "is_active" .IX Subsection "is_active" Returns true if this tab is the currently active one .SS "activate" .IX Subsection "activate" Activate this tab .SS "set_on_activated" .IX Subsection "set_on_activated" Set a callback or method name to invoke when the tab is activated .SS "set_on_deactivated" .IX Subsection "set_on_deactivated" Set a callback or method name to invoke when the tab is deactivated .SS "pen" .IX Subsection "pen" Returns the \f(CW\*(C`Tickit::Pen\*(C'\fR used to draw the label. .PP Pen observers are no longer registered on the return value; to set a different pen on the tab, use the \f(CW\*(C`set_pen\*(C'\fR method instead. .SH "CUSTOM TAB CLASS" .IX Header "CUSTOM TAB CLASS" Rather than use the default built-in object class for tab objects, a \&\f(CW\*(C`Tickit::Widget::Tabbed\*(C'\fR or subclass thereof can return objects in another class instead. This is most useful for subclasses of the tabbed widget itself. .PP To perform this, create a subclass of \f(CW\*(C`Tickit::Widget::Tabbed::Tab\*(C'\fR with a constructor having the following behaviour: .PP .Vb 4 \& sub new \& { \& my $class = shift; \& my ( $tabbed, %args ) = @_; \& \& ... \& \& my $self = $class\->SUPER::new( $tabbed, %args ); \& \& ... \& \& return $self; \& } .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`tab_class\*(C'\fR, or by overriding a method called \f(CW\*(C`TAB_CLASS\*(C'\fR. .PP .Vb 3 \& my $tabbed = Tickit::Widget::Tabbed\->new( \& tab_class => "Tab::Class::Name" \& ); .Ve .PP or .PP .Vb 1 \& use constant TAB_CLASS => "Tab::Class::Name"; .Ve .SH "CUSTOM RIBBON CLASS" .IX Header "CUSTOM RIBBON CLASS" Rather than use the default built-in object class for the ribbon object, a \&\f(CW\*(C`Tickit::Widget::Tabbed\*(C'\fR or subclass thereof can use an object in another subclass instead. This is most useful for subclasses of the tabbed widget itself. .PP For more detail, see the documentation in Tickit::Widget::Tabbed::Ribbon. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "\(bu" 4 Tickit::Widget::Table .IP "\(bu" 4 Tickit::Widget::HBox .IP "\(bu" 4 Tickit::Widget::VBox .IP "\(bu" 4 Tickit::Widget::Tree .IP "\(bu" 4 Tickit::Window .SH "AUTHOR" .IX Header "AUTHOR" Tom Molesworth , Paul Evans .SH "LICENSE" .IX Header "LICENSE" Copyright Tom Molesworth 2011; Paul Evans 2014. Licensed under the same terms as Perl itself.