Tk

 view release on metacpan or  search on metacpan

Change.log  view on Meta::CPAN

Change 2972 on 2003/11/01 by nick@llama

	Naive copy/paste of old iconimage code

Change 2971 on 2003/11/01 by nick@llama

	Slaven's patch for Gedi.pl

Change 2970 on 2003/11/01 by nick@llama

	Fix -foreground on widgets which use Tk::Derived but
	inherit from a widget which has the option (e.g. ROText from Text)

Change 2969 on 2003/11/01 by nick@llama

	Tab focus fix - something is returning '' rather than undef now.

Change 2966 on 2003/10/28 by nick@llama

	Update change log

Change.log  view on Meta::CPAN

Change 2016 on 2000/09/28 by nick@pluto

	Loose obsolete Lang*() decls

Change 2015 on 2000/09/28 by nick@pluto

	Use Tcl_Obj * scheme rather than LangSaveResult().

Change 2014 on 2000/09/28 by nick@pluto

	Re-instate Tk::Derived in Tk::Menu's ISA (though why we did
	that is unclear).

Change 2013 on 2000/09/28 by nick@pluto

	Use Tcl_GetInt rather than coined Lang_GetStrInt for original
	Tcl behaviour.

Change 2012 on 2000/09/28 by nick@pluto

	Make Tcl_ListObjReplace match REFCNT assumptions in tkListbox.c

Change.log  view on Meta::CPAN

	Copy Tcl's Tcl_StringMatch (glob-ish) to encGlue.c (glob-ish match used by fonts)

Change 1996 on 2000/09/26 by nick@pluto

	Allow refs in new style 'Var' glue.

Change 1995 on 2000/09/26 by nick@pluto

	Menus create and clone approximately correctly.
	Menubar display still a little suspect, and have removed
	Tk::Derived from Menu's ISA till we resolve -background => undef
	issue.

Change 1994 on 2000/09/26 by nick@pluto

	Loose "is dummy" warnings
	Fix gross REFCNT issue in new tkConfig code.

Change 1993 on 2000/09/26 by nick@bactrian

	Tcl_GetCommandInfo returns boolean (and used on widgets).

MANIFEST  view on Meta::CPAN

examples/bulkedit		Utility to make changes in many files - with Tk GUI
examples/canvas_ps		Writes PostScript for Canvas to a file.
examples/canvas_scroll		Basic test of scrolling a Canvas
examples/canvasps
examples/canvastile		Test background tiles in a Canvas.
examples/cbtest			Test of callback returns.
examples/chfont			Test of chinese fonts
examples/classtree		Show the Tk class tree.
examples/clip_bug		Demonstrates some "features" of clipping.
examples/cursor_demo		Lists all built-in (X) cursors.
examples/derived_test		Test of Tk::Derived
examples/destroy_test		Test of <Destroy> binding
examples/dialog_test
examples/disbutton
examples/dnd_demo
examples/dump_test
examples/embed
examples/error_prop
examples/ewidth_demo
examples/fedemo
examples/fetail

TextList/Reindex.pm  view on Meta::CPAN

package Tk::Reindex;


use vars qw($VERSION);
$VERSION = '4.006'; # $Id: //depot/Tkutf8/TextList/Reindex.pm#4 $

use Tk;
use base qw(Tk::Derived);


sub Populate
{
 my ($w, $args) = @_;

 $w->_callbase('Populate',$args);

 $w->ConfigSpecs(-linestart    => ["PASSIVE", "lineStart",    "LineStart", 0],
                 -toindexcmd   => ["CALLBACK", "toIndexCmd",  "ToIndexCmd" ,  [\&to_index,$w]],

TextList/TextList.pm  view on Meta::CPAN

# which would be useful for applying tags to part of a line in the list.
#
#######################################################################

package Tk::TextList;

use strict;
use vars qw($VERSION);
$VERSION = '4.006'; # $Id: //depot/Tkutf8/TextList/TextList.pm#5 $

use base qw(Tk::Derived Tk::ReindexedROText );

use Tk qw (Ev);

Construct Tk::Widget 'TextList';

#######################################################################
# the following line causes Populate to get called
# @ISA = qw(Tk::Derived ... );
#######################################################################
sub Populate
{
 my ($w,$args)=@_;
 my $option=delete $args->{'-selectmode'};
 $w->SUPER::Populate($args);
 $w->ConfigSpecs( -selectmode  => ['PASSIVE','selectMode','SelectMode','browse'],
		  -takefocus   => ['PASSIVE','takeFocus','TakeFocus',1],
		  -spacing3    => ['SELF', undef, undef, 3],
		  -insertwidth => ['SELF', undef, undef, 0],

TixGrid/FloatEntry.pm  view on Meta::CPAN


BEGIN
  {
    use vars '$DEBUG';
    $DEBUG = (defined($ENV{USER}) and $ENV{USER} eq 'achx') ? 1 : 0;
    print STDERR "tixGrid: debug = $DEBUG\n" if $DEBUG;
  }

require Tk;
require Tk::Widget;
require Tk::Derived;
require Tk::Entry;

use vars qw($VERSION);
$VERSION = '4.004'; # $Id: //depot/Tkutf8/TixGrid/FloatEntry.pm#4 $

use base  qw(Tk::Derived Tk::Entry);

Construct Tk::Widget 'FloatEntry';

sub ClassInit
  {
    my ($class, $mw) = @_;
    $class->SUPER::ClassInit($mw);
    $mw->bind($class, '<Return>', 'invoke');
    $mw->bind($class, '<FocusIn>', 'FocusIn');
    $class;

Tixish/DirTree.pm  view on Meta::CPAN

#
# Derived from DirTree.tcl in Tix 4.1
#
# Chris Dean <ctdean@cogit.com>

use strict;
use vars qw($VERSION);
$VERSION = '4.022';

use Tk;
use Tk::Derived;
use Tk::Tree;
use Cwd;
use DirHandle;
use File::Spec qw();

use base  qw(Tk::Derived Tk::Tree);
use strict;

Construct Tk::Widget 'DirTree';

my $sep = $^O eq 'MSWin32' ? '\\' : '/';

*_fs_encode = eval { require Encode; 1 } ? sub { Encode::encode("iso-8859-1", $_[0]) } : sub { $_[0] };

sub Populate {
    my( $cw, $args ) = @_;

Tixish/NoteBook.pm  view on Meta::CPAN

# 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;

Tixish/Tree.pm  view on Meta::CPAN

#
# Derived from Tree.tcl in Tix 4.1
#
# Chris Dean <ctdean@cogit.com>
# Changes: Renee Baecker <module@renee-baecker.de>

use vars qw($VERSION);
$VERSION = '4.72'; # $Id: Tree.pm,v 1.4 2007/11/04 09:11:31 eserte Exp $

use Tk ();
use Tk::Derived;
use Tk::HList;
use base  qw(Tk::Derived Tk::HList);
use strict;

Construct Tk::Widget 'Tree';

sub Tk::Widget::ScrlTree { shift->Scrolled('Tree' => @_) }

sub Populate
{
 my( $w, $args ) = @_;

Tk.pod  view on Meta::CPAN

=item *

L<Tk::composite|Tk::composite>

=item *

L<Tk::configspec|Tk::configspec>

=item *

L<Tk::Derived|Tk::Derived>

=item *

L<Tk::mega|Tk::mega>

=item *

L<Tk::ROText|Tk::ROText>

=item *

Tk/Derived.pm  view on Meta::CPAN

# Copyright (c) 1995-2003 Nick Ing-Simmons. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
package Tk::Derived;
require Tk::Widget;
require Tk::Configure;
use strict;
use Carp;

use vars qw($VERSION);
$VERSION = '4.011'; # sprintf '4.%03d', q$Revision: #10 $ =~ /\D(\d+)\s*$/;

$Tk::Derived::Debug = 0;

my $ENHANCED_CONFIGSPECS = 0; # disable for now

use Tk qw(NORMAL_BG BLACK);

sub Subwidget
{
 my $cw = shift;
 my @result = ();
 if (exists $cw->{SubWidget})

Tk/Dirlist.pm  view on Meta::CPAN

package Tk::Dirlist;
require Tk::Derived;
require Tk::HList;
require DirHandle;
use Cwd;

use vars qw($VERSION);
$VERSION = '4.004'; # $Id: //depot/Tkutf8/Tk/Dirlist.pm#5 $

use base  qw(Tk::Derived Tk::HList);
use strict;
Construct Tk::Widget 'Dirlist';

sub getimage
{
 my ($w,$key) = @_;
 unless (exists $w->{$key})
  {
   $w->{$key} = $w->Pixmap(-id => $key);
   unless ($w->{$key})

Tk/Frame.pm  view on Meta::CPAN

# Copyright (c) 1995-2003 Nick Ing-Simmons. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
package Tk::Frame;
require Tk::Widget;
require Tk::Derived;
use AutoLoader;
use strict qw(vars);
use Carp;

use base qw(Tk::Derived Tk::Widget);

Construct Tk::Widget 'Frame';

use vars qw($VERSION);
$VERSION = '4.010'; # $Id: //depot/Tkutf8/Tk/Frame.pm#10 $

sub Tk_cmd { \&Tk::frame }

sub CreateOptions
{

Tk/Menu.pm  view on Meta::CPAN

# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994 Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.

package Tk::Menu;
require Tk;
require Tk::Widget;
require Tk::Wm;
require Tk::Derived;
require Tk::Menu::Item;


use vars qw($VERSION);
$VERSION = '4.023'; # was: sprintf '4.%03d', q$Revision: #21 $ =~ /\D(\d+)\s*$/;

use strict;

use base  qw(Tk::Wm Tk::Derived Tk::Widget);

Construct Tk::Widget 'Menu';

sub Tk_cmd { \&Tk::_menu }

Tk::Methods('activate','add','clone','delete','entrycget','entryconfigure',
            'index','insert','invoke','post','postcascade','type',
            'unpost','yposition');

import Tk qw(Ev);

Tk/Optionmenu.pm  view on Meta::CPAN

# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
package Tk::Optionmenu;
require Tk::Menubutton;
require Tk::Menu;
use Carp;

use vars qw($VERSION);
$VERSION = '4.014'; # $Id: //depot/Tkutf8/Tk/Optionmenu.pm#13 $

use base  qw(Tk::Derived Tk::Menubutton);

use strict;

Construct Tk::Widget 'Optionmenu';

sub Populate
{
 my ($w,$args) = @_;
 $w->SUPER::Populate($args);
 $args->{-indicatoron} = 1;

Tk/Pane.pm  view on Meta::CPAN

# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.

package Tk::Pane;

use vars qw($VERSION);
$VERSION = '4.007'; # $Id: //depot/Tkutf8/Tk/Pane.pm#7 $

use Tk;
use Tk::Widget;
use Tk::Derived;
use Tk::Frame;

use strict;

use base qw(Tk::Derived Tk::Frame);

Construct Tk::Widget 'Pane';

use Tk::Submethods(
  grid => [qw/bbox columnconfigure location propagate rowconfigure size slaves/],
  pack => [qw/propagate slaves/]
);

sub ClassInit {
    my ($class,$mw) = @_;

Tk/ProgressBar.pm  view on Meta::CPAN


use vars qw($VERSION);
$VERSION = '4.015'; # was: sprintf '4.%03d', q$Revision: #10 $ =~ /\D(\d+)\s*$/;

use Tk;
use Tk::Canvas;
use Tk::Trace;
use Carp;
use strict;

use base qw(Tk::Derived Tk::Canvas);

Construct Tk::Widget 'ProgressBar';

sub ClassInit {
    my ($class,$mw) = @_;

    $class->SUPER::ClassInit($mw);

    $mw->bind($class,'<Configure>', ['_layoutRequest',1]);
}

Tk/ROText.pm  view on Meta::CPAN

# Copyright (c) 1995-2003 Nick Ing-Simmons. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
package Tk::ROText;

use vars qw($VERSION);
#$VERSION = sprintf '4.%03d', q$Revision: #10 $ =~ /\D(\d+)\s*$/;
$VERSION = '4.011';

use Tk::Text;
use base  qw(Tk::Derived Tk::Text);

Construct Tk::Widget 'ROText';

sub clipEvents
{
 return qw[Copy];
}

sub ClassInit
{

demos/demos/widget_lib/mega.pl  view on Meta::CPAN

Functional mega-widgets look more like this:

    package Tk::MyNewWidget;

    # Declare base class.
    use base qw/ Tk::Frame /;    # Frame-based composite
or
    use base qw/ Tk::Toplevel /; # Toplevel-based composite
or
    use Tk:SomeWidget;
    use base qw/ Tk::Derived Tk::SomeWidget /; # derived from SomeWidget

    Construct Tk::Widget 'MyNewWidget'; # install MyNewWidget in pTk namespace

    sub ClassInit{               # called once to initialize new class
        my($class, $mw) = @_;
        $class->SUPER::ClassInit($mw);
    }

    sub Populate {               # called to build each widget instance
        my($self, $args) = @_;

demos/demos/widget_lib/mega.pl  view on Meta::CPAN


    # Public methods.

    1; # end class MyNewWidget

    # Don't forget POD documentation here!

Here's an excerpt from a Text derived mega-widget called TraceText; you can examine the complete code in another demonstration. This widget defines its content using a new -textvariable option.

    package Tk::TraceText;
    use base qw/Tk::Derived Tk::Text/;
    Construct Tk::Widget 'TraceText';

    sub Populate {

        my( $self, $args ) = @_;

        $self->ConfigSpecs(
            -textvariable => 'METHOD', 'textVariable', 'TextVariable', undef,
        );

demos/demos/widget_lib/mega.pl  view on Meta::CPAN


    sub textvariable {

        my ( $self, $vref ) = @_;

        $self->traceVariable( $vref, 'w', [ \&tracew => $self, $vref ] );
        $self->{_vref} = $vref;	# store watchpoint in an instance variable
    
    } # end textvariable

If you compare the preamble (the first three lines) with that of the Nil mega-widget, you'll note that they are virtually identical - the important difference is the addition of the Tk::Derived class that provides additional methods specifically for ...

At that point, with three lines of code, we have a completely functional mega-widget called TraceText that is identical to the standard Text widget in every way, and the key to all this is the Construct() call, which, among other duties, installs the...

Construct() also arranges for the TraceText "instantiator" to call-out to the well-known method Populate() - this is how the mega-widget author adds behavior to the new widget. Similarly, the mega-widget author can provide a ClassInit() method that i...

Tk::TraceText::Populate defines the -textvariable option and provides a private method to establish the watchpoint. In Perl/Tk, all mega-widget options are specified via a ConfigSpecs() call, named after the C structure.

Briefly, ConfigSpecs() names options and tells Perl/Tk what to do when one is specified on a configure() or cget() call. It also specifies the option's database name, class name and default value for option DB lookups. For our -textvariable option, t...

More details on mega-widget construction can be found in these man pages:

Tk::ConfigSpecs, Tk::Derived, Tk::composite, Tk::mega

end-of-instructions

} # end mega

demos/demos/widget_lib/trace2.pl  view on Meta::CPAN

# trace2.pl

$Tk::TraceText::VERSION = '1.0';

package Tk::TraceText;

use Tk::widgets qw/ Trace /;
use base qw/ Tk::Derived Tk::Text /;
use strict;

Construct Tk::Widget 'TraceText';

sub Populate {

    my( $self, $args ) = @_;

    $self->SUPER::Populate( $args );

examples/lentry  view on Meta::CPAN

#!/usr/local/bin/perl -w

use Tk;

{
 # This could/should go in Tk/LEntry.pm
 package Tk::LEntry;
 require Tk::Entry;
use base  qw(Tk::Derived Tk::Entry);
 Construct Tk::Widget 'LEntry';

 sub Populate
 {
  my ($w,$args) = @_;
  $w->ConfigSpecs(-maxwidth => ['PASSIVE','maxWidth','MaxWidth',12]);
 }

 sub insert
  {

pod/ConfigSpecs.pod  view on Meta::CPAN

Widgets are most flexible and most Tk-like if they handle the majority of
their attributes this way.

=head2 Configuring composites

Once the above have occurred calls of the form:

    $composite->configure( -attribute => value );

should behave like any other widget as far as end-user code is concerned.
B<configure> will be handled by B<Tk::Derived::configure> as follows:

    $composite->ConfigSpecs;

is called (with no arguments) to return a reference to a hash B<-attribute> is
looked up in this hash, if B<-attribute> is not present in the hash then
B<'DEFAULT'> is looked for instead.  (Aliases are tried as well and cause
redirection to the aliased attribute).  The result should be a reference to a
list like:

  [ where, dbName, dbClass, default ]

pod/ConfigSpecs.pod  view on Meta::CPAN

references (maybe only one) foreach one

   $object->configure( -attribute => value );

is B<eval>ed.

=head2 Inquiring attributes of composites

   $composite->cget( '-attribute' );

This is handled by  B<Tk::Derived::cget> in a similar manner to configure. At
present if I<where> is a list of more than one object it is ignored completely
and the "cached" value in

   $composite->{Configure}{-attribute}.

is returned.

=head1 CAVEATS

The C<-background> and C<-foreground> option values are automatically

pod/Derived.pod  view on Meta::CPAN


=head1 NAME

Tk::Derived - Base class for widgets derived from others

=for pm Tk/Derived.pm

=for category Derived Widgets

=head1 SYNOPSIS

    package Tk::MyNewWidget;

    use Tk::widgets qw/ BaseWidget, list of Tk widgets /;
    use base qw/ Tk::Derived Tk::BaseWidget /;

    Construct Tk::Widget 'MyNewWidget';

    sub ClassInit {
        my( $class, $mw ) = @_;
        #... e.g., class bindings here ...
        $class->SUPER::ClassInit( $mw );
    }

    sub Populate {

pod/Derived.pod  view on Meta::CPAN

   sub something {
       my( $self, $value) = @_;
       if ( @_ > 1 ) {
          # set it
       }
       return # current value
   }

=head1 DESCRIPTION

Tk::Derived is used with Perl's multiple inheritance to override some
methods normally inherited from Tk::Widget.

Tk::Derived should precede any Tk widgets in the class's base class
definition.

Tk::Derived's main purpose is to apply wrappers to C<configure> and C<cget>
methods of widgets to allow the derived widget to add to or modify behaviour
of the configure options supported by the base widget.

The derived class should normally override the C<Populate> method provided
by Tk::Derived and call C<ConfigSpecs> to declare configure options.

The public methods provided by Tk::Derived are as follows:

=over 4

=item -E<gt>ConfigSpecs(-I<key> =E<gt> [I<kind>, I<name>, I<Class>, I<default>], ...)

=back

=head1 SEE ALSO

L<Tk::ConfigSpecs|Tk::ConfigSpecs>

pod/TODO  view on Meta::CPAN

=============

section Item creation:  Toplevel exception is a bit ambigious.
Before talks about 'visual' inclusion.  (Nevertheless Toplevel
is a child of the parent widget even is visual not true).

options.pod
===========

$var=$w->configure(-option) is not documented. But there's a
bug?  Tk::configure and Tk::Derived::configure don't do the
same, return value and optionname, repectively.

Menuoptions
===========

	Check args to -command callback. Doc by N.W. as
	first -textvariablethem -variable 11.25. IMO should
	be -variable first.  Check!

options.pod:

pod/Widget.pod  view on Meta::CPAN


Returns 1 if the colormap for I<$widget> is known to be full, 0
otherwise.  The colormap for a window is ``known'' to be full if the last
attempt to allocate a new color on that window failed and this
application hasn't freed any colors in the colormap since the
failed allocation.

=item I<$widget>-E<gt>B<ConfigSpecs>

Used to perform delegated option configuration for a mega-widget.
Returns, in Tk::Derived::ConfigSpecs notation (see L<Tk::ConfigSpecs>),
all possible options for a widget. For example,

 $s = $self->Scale;
 $self->ConfigSpecs(
     $s->ConfigSpecs,
     .... more ConfigSpecs specifications
 );

returns a hash of all Tk::Scale options, delegated to $s - e.g. some
representative examples:

pod/composite.pod  view on Meta::CPAN

%$args hash with defaults for options from X resources (F<.Xdefaults>, etc).

When  B<Populate> returns to B<Tk::Widget::new()>,
a call to B<$self>-E<gt>I<configure>(%$args) is made which sets *all*
the options.

=head1 SEE ALSO

L<Tk::ConfigSpecs|Tk::ConfigSpecs>
L<Tk::mega|Tk::mega>
L<Tk::Derived|Tk::Derived>

=cut

pod/mega.pod  view on Meta::CPAN

Define the widget's new class name:

S<    >B<package Tk::>I<MyNewWidget>;

For composite widget classes:

S<    >B<use base qw/ Tk::container />; # where B<container> is I<Frame> or I<Toplevel>

For derived widget classes:

S<    >B<use base qw/ Tk::Derived Tk::DerivedWidget /;>

Install the new widget in Tk's namespace and establish class and instance
constructors.

S<    >B<Construct Tk::>I<Widget> I<'MyNewWidget'>;

S<    >B<sub ClassInit> { I<my ($self, $args) = @_; ...> }

S<    >B<sub Populate> { I<my ($self, $args) = @_; ...> }

pod/mega.pod  view on Meta::CPAN

Usage:

    $cw->ConfigSpecs(
        -option => [ where, dbname, dbclass, default],
        ...,
        DEFAULT => [where],
    );

Defines the options of a mega-widget and what actions
are triggered by configure/cget of an option
(see L<Tk::ConfigSpecs> and L<Tk::Derived> for details).

=head2 Construct

Make the new mega-widget known to B<Tk>.

Usage:

S<    >B<Construct> I<baseclass> B<'Name'>;

B<Construct> declares the new widget class so that your mega-widget

pod/mega.pod  view on Meta::CPAN


a I<$self>-E<gt>B<Button> does really a I<$subframe>-E<gt>B<Button>
so the created button is a child of I<$subframe> and not I<$self>.

B<Comment:> Delegates works only with methods that I<$cw> does
not have itself.

=head2 InitObject

I<Note: this method should not, in general, be used, as it has been
superceeded by B<Populate> and specifying B<Tk::Derived> as one of the base
classes.>

Defines construction and interface of derived widgets.

Usage:

    sub InitObject {
	my ($derived, $args) = @_;
	...
    }

pod/options.pod  view on Meta::CPAN

=item I<Value>

The current value (as returned by B<cget>), e.g., C<white>.

=back

=item I<$widget>-E<gt>B<configure>

Returns a list of lists for all the options supported by I<$widget>.
Each sub-list is in the form returned by B<configure>('I<-option>').
(This mechanism is used by the B<Tk::Derived> class to determine
the options available from base class.)

=item I<$widget>-E<gt>B<cget>('I<-option>')

Returns the current value of I<-option> for I<$widget>.

B<cget>('I<-option>') is clumsy with the need for B<''> due to perl's
parsing rules. Something more subtle using L<tie|perlfunc/tie> might look better.

=back

pod/overview.pod  view on Meta::CPAN

A composite is some kind of 'frame' with subwidgets which give it useful behaviour.
B<Tk::Dialog> is an example of
a composite widget classes built from the basic B<Tk> ones.
It is intended that user code should not need to be aware that a particular
class is a composite, and create and configure such widgets in the same manner
as any other kind. The B<configure> mechanism and the methods of the
class manipulate the subwidgets as required.

Composite widgets are implemented via B<Tk::Frame> and multiple inheritance.
The two 'frame' base classes B<Tk::Frame> and
B<Tk::Toplevel> include the additional class B<Tk::Derived>
in their inheritance. B<Tk::Derived> provides methods to allow additional
B<configure> options to be defined for a widget.

A Composite widget is typically defined as derived
from B<Tk::Frame> or B<Tk::Toplevel>
(e.g. B<Tk::Dialog>).

=back

=cut

t/mega.t  view on Meta::CPAN

# -*- perl -*-
BEGIN { $|=1; $^W=1; }

use strict;
use Test;

BEGIN { plan tests => 8 };

use Tk;
use Tk::Widget;
use Tk::Derived;
use Tk::Frame;
use Tk::Button;


my $mw = Tk::MainWindow->new;
eval { $mw->geometry('+10+10'); };  # This works for mwm and interactivePlacement

##
## Tests Component and therefore Subwidget, Delegate a bit
##
{
    print "testing Component() method\n";

    eval <<'EOTEST';

	package Tk::tests::Composite;
        use vars '@ISA';
	@ISA=qw/Tk::Derived Tk::Frame/;
	Construct Tk::Widget 'testComponent';
	sub Populate
	  {
	    my ($cw,$args) = @_;
	    $cw->SUPER::Populate($args);
	    my $b1 = $cw->Component('Button'=>'b1', -delegate=>["invoke"]);
	    $b1->pack;
            $cw;
          }
        package main;



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