Platforms to show: All Mac Windows Linux Cross-Platform

/MacCocoa/Service in Cocoa/TestService


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

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

This example is the version from Sun, 16th Jan 2021.

Project "TestService.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open() ServiceProvider = New MyNSServiceProviderMBS nsapp = NSApplicationMBS.sharedApplication nsapp.servicesProvider = ServiceProvider End EventHandler
Property NSApp As NSApplicationMBS
Property ServiceProvider As MyNSServiceProviderMBS
End Class
Class MainWindow Inherits Window
Control TextArea1 Inherits TextArea
ControlInstance TextArea1 Inherits TextArea
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 MyNSServiceProviderMBS Inherits NSServiceProviderMBS
EventHandler Sub ServiceInvoked(pboard as NSPasteboardMBS, userData as string, byref error as string) Dim s As String = pboard.stringForType(pboard.NSPasteboardTypeString) MainWindow.TextArea1.Text = s s = "“"+s+"”" call pboard.clearContents pboard.stringForType(pboard.NSPasteboardTypeString) = s End EventHandler
EventHandler Function readSelectionFromPasteboard(pboard as NSPasteboardMBS) As Boolean System.DebugLog CurrentMethodName End EventHandler
EventHandler Function validRequestor(sendType as String, returnType as String) As Boolean System.DebugLog CurrentMethodName End EventHandler
EventHandler Function writeSelectionToPasteboard(pboard as NSPasteboardMBS, types() as String) As Boolean System.DebugLog CurrentMethodName End EventHandler
End Class
RunIDEScriptStep
End RunIDEScriptStep
ExternalFile Info
End ExternalFile
End Project

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


The biggest plugin in space...