Dominique Dumont > Puppet-Show-1.007 > Puppet::Show

Download:
Puppet-Show-1.007.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 1.007   Source  

NAME ^

Puppet::Show - Optional Tk Gui for Puppet::Body

SYNOPSIS ^

 use Puppet::Show ;

 package myClass ;

 sub new
  {
    my $type = shift ;
    my $self = {};
    
    # no inheritance, your class contains the Puppet::Show class
    $self->{body} = new Puppet::Show(cloth => $self, @_) ;

    bless $self,$type ;
  }

 package main;

 my $mw = MainWindow-> new ;

 # these 2 parameters are passed to Puppet::Show constructor
 my $test = new MyTest( name => 'foo', 'topTk' => $mw) ;

 $test->display;

 MainLoop ; # Tk's

DESCRIPTION ^

Puppet::Show is a utility class that is used (and not inherited like the deprecated Puppet::Any) to manage a Puppet::Body class through an optional GUI.

So when you construct a Puppet::Show object, you have all the functionnality of this object without the GUI. Then, when the need arises, you may (or the user class may decide to) open the GUI of Puppet::Show so the user may perform any interactive action.

On the other hand, if the need does not arise, you may instanciate a lot of objects (which uses Puppet::Show) without cluttering your display.

The user class may use the Puppet::Show Tk widget (actually a Tk::Multi::Toplevel widget) and add its own widget to customize the GUI to its needs.

This class features :

DEFAULT WINDOWS ^

debug log window

This log window (see Puppet::Log) will get all debug information for this instance of the object. More or less reserved for developers of classes using Puppet::Show.

Note that log sent to the 'event' window will also be displayed in the debug window for better clarity.

event log window

This log window (see Puppet::Log) will get all event information for this instance of the object.

Constructor ^

new( ... )

Creates new Puppet::Show object. The constructor uses all "Constructor" in Puppet::Body parameters plus:

topTk

The ref of the main Tk window

podName

The name of the pod file that will be used for the online help. (See Tk::Pod)

podSection

The name of the pod section that will be used for the online help

Methods ^

acquire(...)

Acquire the object ref as a child. Parameters are:

For instance if object foo acquires object bar, bar becomes part of foo's content and foo is one of the container of bar.

display(...)

Creates a top level display for the user object.

Parameters are:

Return the Tk::Multi::Toplevel object if a display is actually created, undef otherwise (i.e is the display already exists).

myDisplay()

Return the Tk::Multi::Toplevel object created by the display method.

closeDisplay()

Close the display. Note that the display can be re-created later.

About Puppet body classes ^

Puppet classes are a set of utility classes which can be used by any object. If you use directly the Puppet::*Body class, you get the plain functionnality. And if you use the Puppet::* class, you can get the same functionnality and a Tk Gui to manage it.

AUTHOR ^

Dominique Dumont, Dominique_Dumont@grenoble.hp.com

Copyright (c) 1998-1999 Dominique Dumont. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO ^

Tk(3), Puppet::Log(3), Puppet::LogBody(3), Puppet::Body(3), Tk::Multi::Toplevel(3), Tk::Multi::Manager(3)