Example: /MacCocoa/NSAppleEventHandlerMBS test

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCocoa/NSAppleEventHandlerMBS test


Required plugins for this example: MBS MacCocoa Plugin, MBS Util Plugin, MBS MacBase Plugin, MBS Main Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCocoa/NSAppleEventHandlerMBS test

This example is the version from Wed, 16th Oct 2012.

Project "NSAppleEventHandlerMBS test.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open() e = new MyNSAppleEventHandlerMBS dim m as new NSAppleEventManagerMBS // accept GURL event for opening URL m.setEventHandler e, "GURL", "GURL" End EventHandler
Property e As MyNSAppleEventHandlerMBS
End Class
Class Window1 Inherits Window
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() call NSWorkspaceMBS.openURL "http://www.mbsplugins.de" End EventHandler
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action() call NSWorkspaceMBS.openURL "http://www.mbsplugins.de", "com.apple.Safari" End EventHandler
End Control
Control PushButton3 Inherits PushButton
ControlInstance PushButton3 Inherits PushButton
EventHandler Sub Action() call NSWorkspaceMBS.openURL "http://www.mbsplugins.de", "com.google.Chrome" End EventHandler
End Control
Control PushButton4 Inherits PushButton
ControlInstance PushButton4 Inherits PushButton
EventHandler Sub Action() dim p as new ProcessMBS p.GetCurrentProcess dim bundleID as string = p.BundleID call NSWorkspaceMBS.openURL "http://www.mbsplugins.de", bundleID End EventHandler
End Control
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
Class MyNSAppleEventHandlerMBS Inherits NSAppleEventHandlerMBS
EventHandler Sub handleAppleEvent(theEvent as NSAppleEventDescriptorMBS, replyEvent as NSAppleEventDescriptorMBS) // get direct parameter dim p as NSAppleEventDescriptorMBS = theEvent.paramDescriptorForKeyword("----") MsgBox CurrentMethodName+": "+p.stringValue End EventHandler
End Class
End Project

The items on this page are in the following plugins: MBS MacCocoa Plugin.


💬 Ask a question or report a problem