Frame v perltk
Rostislav Matl
xmatl na fi.muni.cz
Úterý Únor 24 10:34:27 MET 1998
#!/usr/bin/perl
use Tk;
sub InitGUI {
sub InitMenu {
my $menu_bar = $toplevel -> Frame( -relief => 'raised',
-borderwidth => '5'
)->pack( -anchor => 'nw',
-fill => 'x'
);
my $file_menu = $menu_bar -> Menubutton( -tearoff => '0',
-text => 'File',
-underline => '0',
-relief => 'groove',
-menuitems =>
[
[ Button => 'Setup',
-command => [\&none],
-accelerator => ''
],
[
Button => 'E~xit',
-command => [\&exit],
-accelerator => 'Alt+x'
]
]
)->pack( -side => 'left');
}
sub InitButtons {
my $button_bar = $toplevel -> Frame( -relief => 'raised',
-borderwidth => '5'
)->pack( -anchor => 'w',
-fill => 'y'
);
my $B1 = $button_bar -> Button( -text => 'Button 2',
-relief => 'raised',
-command => [\&none]
)->pack;#( -fill => 'both');
my $B2 = $button_bar -> Button( -text => 'Button 1',
-relief => 'raised',
-command => [\&none]
)->pack;#( -fill => 'both');
}
$toplevel = new MainWindow;
&InitMenu;
&InitButtons;
MainLoop;
}
sub none {
print "empty function\n";
}
## <main>
&InitGUI;
## </main>
Problem: proc se button_bar v v InitButtons nenatahuje podle y-ove osy,
jak bych cekal ?
Snazil jsem se na to prijit, ale uz opravdu nevim. Za pripadnou radu
dekuji.
--
+-----------------------------------------------------------------------------+
| ROSTISLAV MATL, student of Masaryk University - Faculty of
Informatics |
| e-mail: xmatl na fi.muni.cz WWW:
http://www.fi.muni.cz/~xmatl/index.html |
| favourite citations: "It's a strange world." # "Time to
die." |
| tel: (05) 47 22 98
43 |
+-----------------------------------------------------------------------------+
Další informace o konferenci Perl