Platforms to show: All Mac Windows Linux Cross-Platform
/MacFrameworks/Cocoa Controls/NSButton test
Required plugins for this example: MBS MacFrameworks Plugin, MBS MacBase Plugin, MBS MacControls 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: /MacFrameworks/Cocoa Controls/NSButton test
This example is the version from Sun, 17th Mar 2012.
Project "NSButton test.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control CocoaControlMBS1 Inherits CocoaControlMBS
ControlInstance CocoaControlMBS1 Inherits CocoaControlMBS
EventHandler Function GetView() As NSViewMBS
static n as new MyNSButtonMBS
n.Title = ""
n.bezelstyle = n.NSHelpButtonBezelStyle
Return n
End EventHandler
End Control
Control CocoaControlMBS2 Inherits CocoaControlMBS
ControlInstance CocoaControlMBS2 Inherits CocoaControlMBS
EventHandler Function GetView() As NSViewMBS
static n as new MyNSButtonMBS
n.Title = "Test"
n.bezelstyle = n.NSTexturedRoundedBezelStyle
Return n
End EventHandler
End Control
Control CocoaControlMBS3 Inherits CocoaControlMBS
ControlInstance CocoaControlMBS3 Inherits CocoaControlMBS
EventHandler Function GetView() As NSViewMBS
static n as new MyNSButtonMBS
n.Title = "T"
n.bezelstyle = n.NSCircularBezelStyle
Return n
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 MyNSButtonMBS Inherits NSButtonMBS
EventHandler Sub Action()
MsgBox "Clicked button."
End EventHandler
End Class
End Project
See also:
- /MacFrameworks/Cocoa Controls/Cocoa Controls
- /MacFrameworks/Cocoa Controls/Custom NSView
- /MacFrameworks/Cocoa Controls/NSComboBox Example
- /MacFrameworks/Cocoa Controls/NSProgressIndicator
- /MacFrameworks/Cocoa Controls/NSSearchfield with event
- /MacFrameworks/Cocoa Controls/ProgressIndicator
- /MacFrameworks/Cocoa Controls/SearchField with menu
- /MacFrameworks/Cocoa Controls/SecureTextField
- /MacFrameworks/Cocoa Controls/SliderView
- /MacFrameworks/Cocoa Controls/TableView with scrollbars
The items on this page are in the following plugins: MBS MacFrameworks Plugin.