package Teil; use strict; use warnings; use Tk; use Tk::PNG; =head1 METHODEN =head2 suchfeld( $top, $breite_des_entrys, $methode_fuer_button, $diverse_optionen_href ) Erzeugt ein Frame mit den Kindelementen Entry und Button (mit Lupe als Bild), sowie einer Bindung des Entries auf die Enter-Taste um das Kommando des Buttons auszuführen. =cut sub suchfeld { my $self = shift; my $top = shift; my $entry_w = shift; my $btn_cmd = shift; my $opts = shift; my %sf = (); # sf = suchfeld $sf{frame} = $top->Frame(); if( exists $opts->{pack} and $opts->{pack} == 1 ) { $sf{frame}->pack(); } $sf{entry} = $sf{frame}->Entry(-width => $entry_w)->pack(-side => 'left',); $sf{photo} = $top->Photo(-file => 'C:/Perl/Scripten/CELEX/CELEX/Divers/GUI/Images/Gnome-mix/16x16/actions/mail_find.png'); $sf{button} = $sf{frame}->Button(-image => $sf{photo}, -command => $btn_cmd)->pack(-side => 'left',); $sf{entry}->bind('', $btn_cmd); return \%sf; } # /suchfeld 1; # /Teil, Name von der Redaktion geändert ^^