package Navi; use strict; use warnings; use Tk::Tree; my $EventHandler = undef; sub new { my($this, $top) = @_; bless my $self = {} => (ref $this) || $this; $self->{tree} = $top->Scrolled ( qw/Tree/ ) ->pack; $self->{tree}->bind('', [ \&TreeEvent ]); $self->{tree}->bind('' , [ \&TreeEvent ]); # # Hier Tree befüllen # $self->{tree}->autosetmode; } sub TreeEvent { my($this) = @_; # !!! Nicht Objekt, sondern Tree=HASH(...) ??? return unless my $sl = $this->info('selection'); &$EventHandler($this->info('data', $sl)); } sub SetCallBackEvent { my($this, $event) = @_; # Hier $this - o.k. $EventHandler = $event; }