Required plugins for this example: MBS MacBase Plugin, MBS Main Plugin, MBS MacCocoa Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacBase/
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control Rectangle1 Inherits Rectangle
ControlInstance Rectangle1 Inherits Rectangle
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
dim n as NSViewMBS = Rectangle1.NSViewMBS
dim g as new NSGraphicsMBS(n)
g.SetColorRGB 0,0,1
g.fillRect(0,0,100,100,g.NSCompositeCopy)
End EventHandler
End Control
Control CheckBox1 Inherits CheckBox
ControlInstance CheckBox1 Inherits CheckBox
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action()
dim n as NSViewMBS = checkbox1.NSViewMBS
dim g as new NSGraphicsMBS(n)
g.SetColorRGB 0,0,1
g.fillRect(0,0,100,100,g.NSCompositeCopy)
End EventHandler
End Control
EventHandler Sub Open()
if not TargetCocoa then
MsgBox "This sample requires Cocoa target!"
end if
End EventHandler
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