Example: /MacControls/NSButtonControl tests/NSButtonControl2

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

/MacControls/NSButtonControl tests/NSButtonControl2


Required plugins for this example: 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: /MacControls/NSButtonControl tests/NSButtonControl2

This example is the version from Tue, 9th Dec 2013.

Project "NSButtonControl2.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control Label1 Inherits Label
ControlInstance Label1 Inherits Label
End Control
EventHandler Sub Open() #if TargetCocoa then dim c as new NSButtonControlContainer c.EmbedWithin(self, 322, 177, c.Width, c.Height) // we need to route the action event to our window dim w as NSButtonControlMBS = c.NSButtonControlMBS1 AddHandler w.Action, WeakAddressOf clicked #endif End EventHandler
Sub Clicked(o as object) #if TargetCocoa then dim n as NSButtonControlMBS = NSButtonControlMBS(o) MsgBox "Clicked" #endif End Sub
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
Class NSButtonControlContainer Inherits ContainerControl
Control NSButtonControlMBS1 Inherits NSButtonControlMBS
ControlInstance NSButtonControlMBS1 Inherits NSButtonControlMBS
End Control
End Class
End Project

See also:

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


💬 Ask a question or report a problem