Tk-AppWindow

 view release on metacpan or  search on metacpan

lib/Tk/AppWindow/BaseClasses/ContentManager.pm  view on Meta::CPAN

package Tk::AppWindow::BaseClasses::ContentManager;

=head1 NAME

Tk::AppWindow::BaseClasses::ContentManager - baseclass for content handling

=cut

use strict;
use warnings;
use Carp;

use vars qw($VERSION);
$VERSION="0.20";

use Tk;
use base qw(Tk::Derived Tk::Frame);
Construct Tk::Widget 'ContentManager';

use File::Basename;


=head1 SYNOPSIS

 #This is useless
 require Tk::AppWindow::BaseClasses::ContentManager;
 my $handlerplug = $app->ContentManager->pack;

 #This is what you should do
 package MyContentHandler
 use base qw(Tk::Derived Tk::AppWindow::BaseClasses::ContentManager);
 Construct Tk::Widget 'MyContentHandler';

=head1 DESCRIPTION

This is an opaque base class to help you create a content manager for your application.

It is Tk::Frame based and you can inherit it as a Tk mega widget;

The methods below are used by the extensions MDI and SDI. It is for you to make
them do the right stuff by overriding them.

=head1 OPTIONS

=over 4

=item B<-extension>

Reference to the document interface extension (MDI, SDI or other) that is creating the 
content handler.

This option is mandatory!

=back

=head1 METHODS

=over 4

=cut

sub Populate {
	my ($self,$args) = @_;
	
	my $ext = delete $args->{'-extension'};
	carp "Option -extension mustt be specified" unless defined $ext;
	
	$self->SUPER::Populate($args);
	$self->{EXT} = $ext;

	$self->ConfigSpecs(
		DEFAULT => ['SELF'],
	);
	$self->after(20, ['ConfigureCM', $self]);
}

=item B<Close>

In the current form it makes a call to B<doclear> and returns 1.
Override it to do the things neede to close your content.
Return a boolean for succes or failure.

=cut

sub Close {
	my $self = shift;
	$self->doClear;
	return 1
}

sub ConfigureCM {



( run in 0.405 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )