Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCocoa/Process Activity
Required plugins for this example: MBS MacCocoa Plugin, MBS Main Plugin, MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCocoa/Process Activity
This example is the version from Thu, 30th Oct 2013.
Project "Process Activity.rbp"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class MainWindow Inherits Window
Control PopupOptions Inherits PopupMenu
ControlInstance PopupOptions Inherits PopupMenu
End Control
Control Label1 Inherits Label
ControlInstance Label1 Inherits Label
End Control
Control StartButton Inherits BevelButton
ControlInstance StartButton Inherits BevelButton
EventHandler Sub Action() dim options as integer = PopupOptions.RowTag(PopupOptions.ListIndex) activity = info.beginActivity(options, reason.Text) EndButton.Enabled = true End EventHandler
End Control
Control EndButton Inherits BevelButton
ControlInstance EndButton Inherits BevelButton
EventHandler Sub Action() info.endActivity activity activity = nil me.Enabled = false End EventHandler
End Control
Control Label2 Inherits Label
ControlInstance Label2 Inherits Label
End Control
Control reason Inherits TextField
ControlInstance reason Inherits TextField
End Control
EventHandler Sub Open() PopupOptions.DeleteAllRows PopupOptions.AddRow "Idle Display Sleep Disabled", NSProcessInfoMBS.NSActivityIdleDisplaySleepDisabled PopupOptions.AddRow "Idle System Sleep Disabled", NSProcessInfoMBS.NSActivityIdleSystemSleepDisabled PopupOptions.AddRow "Sudden Termination Disabled", NSProcessInfoMBS.NSActivitySuddenTerminationDisabled PopupOptions.AddRow "Background", NSProcessInfoMBS.NSActivityBackground PopupOptions.AddRow "Latency Critical", NSProcessInfoMBS.NSActivityLatencyCritical PopupOptions.AddRow "User Initiated", NSProcessInfoMBS.NSActivityUserInitiated PopupOptions.AddRow "User Initiated Allowing Idle System Sleep", NSProcessInfoMBS.NSActivityUserInitiatedAllowingIdleSystemSleep PopupOptions.ListIndex = 0 if not SystemInformationMBS.isMavericks then MsgBox "This feature requires Mac OS X 10.9." end if info = NSProcessInfoMBS.processInfo End EventHandler
Property activity As NSProcessInfoActivityMBS
Property info As NSProcessInfoMBS
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
Module UtilModule
Sub AddRow(extends p as PopupMenu, text as string, tag as Variant) p.AddRow text p.RowTag(p.ListCount-1) = tag End Sub
End Module
End Project

Feedback, Comments & Corrections

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

MBS Xojo tutorial videos