Platforms to show: All Mac Windows Linux Cross-Platform
/MacControls/Quartz Composer Control/QCView
Required plugins for this example: MBS MacFrameworks Plugin, MBS MacBase Plugin, MBS Main Plugin, MBS MacControls Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacControls/Quartz Composer Control/QCView
This example is the version from Thu, 6th Apr 2016.
Project "QCView.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open()
if not TargetMachO then
MsgBox "This project requires Mac OS X."
quit
end if
End EventHandler
End Class
Class Window1 Inherits Window
Control CocoaControlMBS1 Inherits CocoaControlMBS
ControlInstance CocoaControlMBS1 Inherits CocoaControlMBS
EventHandler Function GetView() As NSViewMBS
image = LogoMBS(500)
NSImage = new NSImageMBS(image)
v = new QCViewMBS
dim f as FolderItem = GetFolderItem("/System/Library/Compositions/Kaleidescope.qtz", FolderItem.PathTypeShell)
if v.loadCompositionFromFile(f) then
if v.setValueForInputKey(NSImage, "_protocolInput_Image") then
v.autostartsRendering=true
// display input keys:
'dim s(-1) as string = v.inputKeys
'MsgBox Join(s,EndOfLine)
end if
end if
Return v
End EventHandler
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
v.unloadComposition
dim f as FolderItem = GetFolderItem("/System/Library/Compositions/Pixellate.qtz", FolderItem.PathTypeShell)
if v.loadCompositionFromFile(f) then
if v.setValueForInputKey(NSImage, "_protocolInput_Image") then
if v.startRendering then
// okay
end if
end if
end if
End EventHandler
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action()
v.unloadComposition
dim f as FolderItem = GetFolderItem("/System/Library/Compositions/Kaleidescope.qtz", FolderItem.PathTypeShell)
if v.loadCompositionFromFile(f) then
if v.setValueForInputKey(NSImage, "_protocolInput_Image") then
if v.startRendering then
// okay
end if
end if
end if
End EventHandler
End Control
Control PushButton3 Inherits PushButton
ControlInstance PushButton3 Inherits PushButton
EventHandler Sub Action()
v.unloadComposition
dim f as FolderItem = GetFolderItem("/System/Library/Compositions/Tracer.qtz", FolderItem.PathTypeShell)
if v.loadCompositionFromFile(f) then
if v.setValueForInputKey(NSImage, "_protocolInput_Image") then
if v.startRendering then
// okay
end if
end if
end if
End EventHandler
End Control
Control PushButton4 Inherits PushButton
ControlInstance PushButton4 Inherits PushButton
EventHandler Sub Action()
v.unloadComposition
dim f as FolderItem = GetFolderItem("/System/Library/Compositions/Travelator.qtz", FolderItem.PathTypeShell)
if v.loadCompositionFromFile(f) then
if v.startRendering then
// okay
end if
end if
End EventHandler
End Control
Property image As Picture
Property nsimage As NSImageMBS
Property v As QCViewMBS
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
End Project
See also:
The items on this page are in the following plugins: MBS MacControls Plugin.