Curses::UI::Notebook - Create and manipulate notebook widgets. |
Curses::UI::Notebook - Create and manipulate notebook widgets.
Curses::UI::Widget | +----Curses::UI::Container | +----Curses::UI::Notebook
use Curses::UI; my $cui = new Curses::UI; my $win = $cui->add(undef, 'Window');
my $notebook = $win->add(undef, 'Notebook'); my $page1 = $notebook->add_page('page 1'); $page1->add( undef, 'Label', -x => 15, -y => 6, -text => "Page #1.", ); my $page2 = $notebook->add_page('page 2'); $page2->add( undef, 'Label', -x => 15, -y => 6, -text => "Page #2.", ); my $page3 = $notebook->add_page('page 3'); $page3->add( undef, 'Label', -x => 15, -y => 6, -text => "Page #3.", ); $notebook->focus; $cui->mainloop;
This package implements a notebook widget similar to that found in Motif. A notebook holds several windows, or pages, only one of which is visible at any given time; tabs at the top of the widget list the pages that are available. In this way, a great deal of information can be fit into a relatively small screen area. [Windows users might recognize this as a tabbed dialog.]
-x, -y, -width, -height, -pad, -padleft, -padright, -padtop, -padbottom, -ipad, -ipadleft, -ipadright, -ipadtop, -ipadbottom, -border, -sbborder, -bg, -fg, -intellidraw, -onchange, -onblur.
See Curses::UI::Widget for a discussion of each of these options.
Note that -border is enabled and both -ipadleft and -ipadright
are set to 1
by default when creating notebook objects.
By default, the following mappings are used:
KEY ROUTINE ------------------ ---------- KEY_HOME, Ctrl-A first_page KEY_END, Ctrl-E last_page KEY_NPAGE, Ctrl-N next_page KEY_PPAGE, Ctrl-P prev_page
By default, the following mappings are used:
ROUTINE ACTION ---------- ------------------------- first_page make first page active last_page make last page active next_page make next page active prev_page make previous page active
By default, it is true.
By default, BOOLEAN is true so the screen is updated.
Note: the add fails if the page would otherwise cause the tab window to overflow or is already part of the notebook object.
Curses::UI, Curses::UI::Container, Curses::UI::Widget
George A. Theall, <theall@tifaware.com>
Copyright (c) 2004, George A. Theall. All rights reserved.
This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Curses::UI::Notebook - Create and manipulate notebook widgets. |