Thread GUI in Form von Windows Explorer erstellen
(15 answers)
Opened by Mampfgnom at 2010-10-27 15:05
Guten Morgen.
Jetzt habe ich wirklich mal ein grafisches Problem. Warum auch immer will mir Perl meine Widgets nicht so anordnen wie ich will. Zur Erinnerung . . . oben Menüleiste, darunter ein Labentry und darunter 2 gleich große Bereiche nebeneinander. Die 2 Bereiche will ich erst mal durch Frames abgrenzen, allerdings hängt es hier schon. Perl ordnert mir die Frames irgend wie an. Findet von euch einer bei mir einen Fehler? Code (perl): (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 40 41 42 43 44 45 46 47 48 49 50 51 52 #!/usr/bin/perl use Tk; use Tk::LabEntry; use Tk::DirTree; use Tk::HList; use Cwd; #use pam_aba_103_17; #use pam_aba_24_10; my $mw = MainWindow->new(-title=>"PAM_ABA v1.7"); # MainWindow my $width = $mw->screenwidth; my $height = $mw->screenheight; $mw->geometry($width.'x'.$height); $mw->configure(-menu => my $menubar = $mw->Menu); # Menüleiste my $materialtyp = $menubar->cascade(-label => '~Materialtyp', -tearoff=>0); #$menubar->command(-command=>\&konvertieren, -label=>"~Konvertieren"); #$menubar->command(-command=>\&verzeichnis, -label=>"~Verzeichnis"); $menubar->command(-command=>sub{exit}, -label=>"~Beenden"); @typ = ("SHE 103", "SOL 24"); # Materialtypen $i=0; foreach $typ (@typ){ $i++; $materialtyp->radiobutton(-label=>$typ, -variable=>\$rb, -value=>$i); } $rb = 1; $frame_hintergrund = $mw->Frame(-bg=>'green')->pack(-fill=>'both', -expand=>1); $frame0 = $frame_hintergrund->Frame(-height=>30, -bg=>'blue')->pack(-side=>'top', -expand=>1, -fill=>'x', -anchor=>'n'); #chdir("../Materialverzeichnis"); $pfad_mat = getcwd(); $LE = $frame0->LabEntry(-label=>"Abaqus Materialverzeichnis", -labelPack=>[-side=>'right'], -width=>80, -text=>"$pfad_mat")->pack(-padx=>20, -pady=>5); $frame1 = $frame_hintergrund->Frame(-width=>int($width/2), -bg=> 'red') ->pack(-side=>'left', -fill=>'y',-expand=>1); $frame2 = $frame_hintergrund->Frame(-width=>int($width/2), -bg=> 'yellow') ->pack(-expand=>1, -fill=>'y', -side=>'right', -anchor=>'e'); $DIR_TREE = $frame2->Scrolled('DirTree', -scrollbars => "osoe", -width => 30, -height => 25, -exportselection => 1, -browsecmd => sub {$cwd = shift}, -command => \&callback) ->pack(-fill => "both", -expand => 1); Last edited: 2010-10-29 08:54:40 +0200 (CEST) |