Hi all,
I just took my first steps to build a GUI in Perl fom my log analyser.
Now I want to create a standard topmenu with dropdown menus.
I have the following code, but it does not seem to display the second menu item I want to show. (first being file and next to it I want edit). When I change the variable to 'right' next to the pack method it does show only on the other side of the menu instead of next to it. :-S Does someone have suggestions?
Code:
# Test GUI
use Tk;
$main = MainWindow->new();
$menubar = $main->Frame( - relief => "raised",
- borderwidth => 2)
->pack ( - anchor => "nw",
- fill => "x"
;
$file_menu = $menubar->Menubutton( - text => "File",
- underline => 1,
- menuitems => [
[ Button => "Open", -command => \&Open ],
[ Button => "Save as", -command => \&SaveAs ]
]
)
-> pack( - side => "left"
;
$file_menu = $menubar->Menubutton( - text => "Edit",
- underline => 1,
- menuitems => [
[ Button => "Cut", -command => \&Print ],
[ Button => "Copy", -command => \&Save ]
]
);
#-> pack( - side => "left"
;
MainLoop;
"Free will...is an illusion"
I just took my first steps to build a GUI in Perl fom my log analyser.
Now I want to create a standard topmenu with dropdown menus.
I have the following code, but it does not seem to display the second menu item I want to show. (first being file and next to it I want edit). When I change the variable to 'right' next to the pack method it does show only on the other side of the menu instead of next to it. :-S Does someone have suggestions?
Code:
# Test GUI
use Tk;
$main = MainWindow->new();
$menubar = $main->Frame( - relief => "raised",
- borderwidth => 2)
->pack ( - anchor => "nw",
- fill => "x"
$file_menu = $menubar->Menubutton( - text => "File",
- underline => 1,
- menuitems => [
[ Button => "Open", -command => \&Open ],
[ Button => "Save as", -command => \&SaveAs ]
]
)
-> pack( - side => "left"
$file_menu = $menubar->Menubutton( - text => "Edit",
- underline => 1,
- menuitems => [
[ Button => "Cut", -command => \&Print ],
[ Button => "Copy", -command => \&Save ]
]
);
#-> pack( - side => "left"
MainLoop;
"Free will...is an illusion"