Example: /MacOSX/Sleep Notification

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

/MacOSX/Sleep Notification


Required plugins for this example: MBS MacOSX Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacOSX/Sleep Notification

This example is the version from Mon, 18th Mar 2012.

Project "Sleep Notification.xojo_binary_project"
FileTypes
Filetype text
End FileTypes
Class Window1 Inherits Window
Control ListBox1 Inherits ListBox
ControlInstance ListBox1 Inherits ListBox
End Control
EventHandler Sub Open() if TargetMachO then s=new SleepNotification else MsgBox "Please use a MachO target!" end if End EventHandler
Property Protected s As sleepNotification
End Class
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
Class SleepNotification Inherits SleepNotificationMBS
EventHandler Function Sleep(message as int64) As boolean dim s as string Select case message case kIOMessageCanSystemPowerOff s="CanSystemPowerOff" case kIOMessageCanSystemSleep s="CanSystemSleep" case kIOMessageSystemHasPoweredOn s="SystemHasPoweredOn" case kIOMessageSystemWillNotPowerOff s="SystemWillNotPowerOff" case kIOMessageSystemWillPowerOff s="SystemWillPowerOff" case kIOMessageSystemWillNotSleep s="SystemWillNotSleep" case kIOMessageSystemWillPowerOn s="SystemWillPowerOn" case kIOMessageSystemWillRestart s="SystemWillRestart" case kIOMessageSystemWillSleep s="SystemWillSleep" else s=hex(message) end Select window1.ListBox1.AddRow s Return true // deny request End EventHandler
End Class
End Project

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


💬 Ask a question or report a problem