Tk
view release on metacpan or search on metacpan
Tixish/NoteBook.pm view on Meta::CPAN
package Tk::NoteBook;
#
# Implementation of NoteBook widget.
# Derived from NoteBook.tcl in Tix 4.0
# Contributed by Rajappa Iyer <rsi@earthling.net>
# Hacked by Nick for 'menu' traversal.
# Restructured by Nick
use vars qw($VERSION);
#$VERSION = sprintf '4.%03d', q$Revision: #9 $ =~ /\D(\d+)\s*$/;
$VERSION = '4.012';
require Tk::NBFrame;
use base qw(Tk::Derived Tk::NBFrame);
Tk::Widget->Construct('NoteBook');
use strict;
use Tk qw(Ev);
use Carp;
require Tk::Frame;
sub TraverseToNoteBook;
sub ClassInit
{
my ($class,$mw) = @_;
# class binding does not work right due to extra level of
# widget hierachy
$mw->bind($class,'<ButtonPress-1>', ['MouseDown',Ev('x'),Ev('y')]);
$mw->bind($class,'<ButtonRelease-1>', ['MouseUp',Ev('x'),Ev('y')]);
$mw->bind($class,'<B1-Motion>', ['MouseDown',Ev('x'),Ev('y')]);
$mw->bind($class,'<Left>', ['FocusNext','prev']);
$mw->bind($class,'<Right>', ['FocusNext','next']);
$mw->bind($class,'<Return>', 'SetFocusByKey');
$mw->bind($class,'<space>', 'SetFocusByKey');
return $class;
}
sub raised
{
return shift->{'topchild'};
}
sub Populate
{
my ($w, $args) = @_;
$w->SUPER::Populate($args);
$w->{'pad-x1'} = undef;
$w->{'pad-x2'} = undef;
$w->{'pad-y1'} = undef;
$w->{'pad-y2'} = undef;
$w->{'windows'} = [];
$w->{'nWindows'} = 0;
$w->{'minH'} = 1;
$w->{'minW'} = 1;
$w->{'counter'} = 0;
$w->{'resize'} = 0;
$w->ConfigSpecs(-ipadx => ['PASSIVE', 'ipadX', 'Pad', 0],
-ipady => ['PASSIVE', 'ipadY', 'Pad', 0],
-takefocus => ['SELF', 'takeFocus', 'TakeFocus', 0],
-dynamicgeometry => ['PASSIVE', 'dynamicGeometry', 'DynamicGeometry', 0]);
# SetBindings
$w->bind('<Configure>','MasterGeomProc');
$args->{-slave} = 1;
$args->{-takefocus} = 1;
( run in 0.393 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )