Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hutchinson <mhutchinson@novell.com>2010-01-22 10:20:42 +0300
committerMichael Hutchinson <mhutchinson@novell.com>2010-01-22 10:20:42 +0300
commit743fb05a412c01ea9cd22a07efbfbeb922d0c3ba (patch)
tree67643f260668fdb213c17674fae13564545833ec /docbrowser
parentf4267d1e9fb2ef687c934485b9ed5459257f00a9 (diff)
Enable the IGE main menu and global key handlers
svn path=/trunk/mono-tools/; revision=150045
Diffstat (limited to 'docbrowser')
-rw-r--r--docbrowser/browser.cs30
1 files changed, 22 insertions, 8 deletions
diff --git a/docbrowser/browser.cs b/docbrowser/browser.cs
index 6033a5be..2b26ec37 100644
--- a/docbrowser/browser.cs
+++ b/docbrowser/browser.cs
@@ -292,7 +292,11 @@ public class Browser {
public Browser (string basedir, IEnumerable<string> sources, string engine)
{
#if MACOS
- InitMacAppHandlers();
+ try {
+ InitMacAppHandlers();
+ } catch (Exception ex) {
+ Console.Error.WriteLine ("Installing Mac AppleEvent handlers failed. Skipping.\n" + ex);
+ }
#endif
this.engine = engine;
@@ -400,17 +404,27 @@ public class Browser {
index_browser = IndexBrowser.MakeIndexBrowser (this);
MainWindow.ShowAll();
-#if false && MACOS
- ((MenuBar)ui["menubar1"]).Hide ();
- IgeMacIntegration.IgeMacMenu.MenuBar = (MenuBar) ui["menubar1"];
- IgeMacIntegration.IgeMacMenu.QuitMenuItem = (MenuItem) ui["quit1"];
- var appGroup = IgeMacIntegration.IgeMacMenu.AddAppMenuGroup ();
- appGroup.AddMenuItem ((MenuItem)ui["quit1"], null);
- appGroup.AddMenuItem ((MenuItem)ui["about1"], null);
+#if MACOS
+ try {
+ InstallMacMainMenu ();
+ ((MenuBar)ui["menubar1"]).Hide ();
+ } catch (Exception ex) {
+ Console.Error.WriteLine ("Installing Mac IGE Main Menu failed. Skipping.\n" + ex);
+ }
#endif
}
#if MACOS
+ void InstallMacMainMenu ()
+ {
+ IgeMacIntegration.IgeMacMenuGlobal.SetGlobalKeyHandlerEnabled (true);
+ IgeMacIntegration.IgeMacMenu.MenuBar = (MenuBar) ui["menubar1"];
+ IgeMacIntegration.IgeMacMenu.QuitMenuItem = (MenuItem) ui["quit1"];
+ var appGroup = IgeMacIntegration.IgeMacMenu.AddAppMenuGroup ();
+ appGroup.AddMenuItem ((MenuItem)ui["quit1"], null);
+ appGroup.AddMenuItem ((MenuItem)ui["about1"], null);
+ }
+
void InitMacAppHandlers ()
{
ApplicationEvents.Quit += delegate (object sender, ApplicationEventArgs e) {