Platforms to show: All Mac Windows Linux Cross-Platform
/MacCocoa/NSWorkSpace Icon Images
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/NSWorkSpace Icon Images
This example is the version from Sun, 24th Nov 2012.
Project "NSWorkSpace Icon Images.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open()
dim f as FolderItem = SpecialFolder.Desktop
dim n as NSImageMBS = NSWorkspaceMBS.iconForFile(f)
dim reps() as NSImageRepMBS = n.representations
for each r as NSImageRepMBS in reps
window1.Listbox1.AddRow str(r.width), str(R.height), str(r.pixelsWide), str(R.pixelsHigh), str(R.pixelsWide>r.width)
n.removeRepresentation r
dim nn as new NSImageMBS(r.pixelsWide, r.pixelsHigh)
nn.addRepresentation r
dim w as new window2
w.Backdrop = nn.CopyPictureWithMask
w.Width = r.pixelswide
w.height = r.pixelshigh
next
End EventHandler
End Class
Class Window1 Inherits Window
Control Listbox1 Inherits Listbox
ControlInstance Listbox1 Inherits Listbox
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 Window2 Inherits Window
End Class
End Project
See also:
The items on this page are in the following plugins: MBS MacCocoa Plugin.