From 230d4377c90c2c66d6bd95918f34148a2ca75c07 Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Tue, 12 Jun 2012 23:46:50 +0200 Subject: [PATCH] Fix display of special menu items (wxID_ABOUT, wxID_EXIT) on OS X --- lib/Slic3r/GUI.pm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/Slic3r/GUI.pm b/lib/Slic3r/GUI.pm index 600708bf..4e511017 100644 --- a/lib/Slic3r/GUI.pm +++ b/lib/Slic3r/GUI.pm @@ -29,9 +29,6 @@ sub OnInit { # menubar my $menubar = Wx::MenuBar->new; - $frame->SetMenuBar($menubar); - EVT_MENU($frame, wxID_EXIT, sub {$_[0]->Close(1)}); - EVT_MENU($frame, wxID_ABOUT, \&About); # status bar $frame->{statusbar} = Slic3r::GUI::ProgressStatusBar->new($frame, -1); @@ -55,6 +52,17 @@ sub OnInit { EVT_MENU($frame, 4, sub { $panel->do_slice(reslice => 1) }); EVT_MENU($frame, 5, sub { $panel->do_slice(save_as => 1) }); EVT_MENU($frame, 6, sub { $panel->do_slice(save_as => 1, export_svg => 1) }); + EVT_MENU($frame, wxID_EXIT, sub {$_[0]->Close(1)}); + + # Help menu + my $helpMenu = Wx::Menu->new; + $helpMenu->Append(wxID_ABOUT, "&About"); + $menubar->Append($helpMenu, "&Help"); + EVT_MENU($frame, wxID_ABOUT, \&About); + + # Set the menubar after appending items, otherwise special items + # will not be handled correctly + $frame->SetMenuBar($menubar); $box->SetSizeHints($frame); $frame->SetSizer($box);