Leser: 2
2 Einträge, 1 Seite |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
foreach (@cfg_content) { ... my $subframe= $file_frame_main ->Frame(-relief =>'groove',-borderwidth =>2)->pack(-padx => 5, -pady => 1,-side => 'top',-anchor=>'nw',-fill=>'x'); #Frame for file info my $sub_header= $subframe ->Frame()->pack(-side=>'top',-fill=>'x'); my $sub_read_sect= $subframe ->Frame()->pack(-side=>'top',-fill=>'x'); $sub_header->Label(-text => "$gui_text ($abbr)\[$framecounter\]")->pack(-side =>'top',-fill=>'x'); my $sub_read_sect_entry=$sub_read_sect->Entry()->pack(-anchor=>'w',-side=>'left'); $sub_read_sect->Button(-text => "for reading",-command => sub { @sub_write_sect_entry[$framecounter]->delete(0,length(@sub_write_sect_entry[$framecounter]->get())); print "$framecounter" } )->pack(-anchor=>'e',-side=>'right',-fill=>'x'); $framecounter+=1; ... }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl
use strict;
use warnings;
use Tk;
my $mw = MainWindow->new();
foreach my $index (1..6){
my $frame = $mw->Frame()->pack();
$frame->Button(
-text => "Button $index",
-command => sub{
print "Frame $index\n";
}
)->pack();
}
Tk::MainLoop();
2 Einträge, 1 Seite |