Thread Tk: eigenes widget(canvas): Optionen werden nicht weitergeleitet? (4 answers)
Opened by PerlProfi at 2006-12-26 16:20

renee
 2007-01-03 13:19
#46049 #46049
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
So geht's:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/perl

package Test;

use base qw(Tk::Derived Tk::Frame);
use Tk::widgets qw(Canvas);
Construct Tk::Widget 'Test';

use strict;
use warnings 'all';

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

$args->{-background} = 'black' unless defined $args->{-background};
# create Frame
$frame->SUPER::Populate($args);

# create Canvas
my $canvas = $frame->Component(Canvas => 'canvas',)->pack();

# delegates and configspecs
$frame->Delegates (DEFAULT => $frame);
$frame->ConfigSpecs(DEFAULT => [$canvas]);

return $frame;
} # Populate

package main;

use strict;
use warnings 'all';
use Tk;

my $mw = tkinit();
my $test = $mw->Test()->pack();

MainLoop;
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread Tk: eigenes widget(canvas): Optionen werden nicht weitergeleitet?