Platforms to show: All Mac Windows Linux Cross-Platform
/MacFrameworks/FSEvents/FSEvents for files
Required plugins for this example: MBS MacFrameworks Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacFrameworks/FSEvents/FSEvents for files
This example is the version from Fri, 12th Nov 2015.
Project "FSEvents for files.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control ListBox1 Inherits ListBox
ControlInstance ListBox1 Inherits ListBox
End Control
EventHandler Sub Close()
f.stop
End EventHandler
EventHandler Sub Open()
dim eventid as UInt64
dim flags as integer
dim latency as Double
eventid = FSEventsMBS.GetCurrentEventId
// requires Mac OS X 10.7
flags = FSEventsMBS.kFSEventStreamCreateFlagFileEvents
latency=1.0
f=new FSEvents(SpecialFolder.Desktop, eventid, latency, flags)
// show description for debugging
'MsgBox f.Description
// and on console (stderr)
'f.Show
if not f.Start then
MsgBox "Failed to start."
end if
End EventHandler
Property f As fsevents
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
Class FSEvents Inherits FSEventsMBS
EventHandler Sub Callback(index as integer, count as integer, path as string, flags as integer, eventID as UInt64)
dim l as listbox
l=window1.ListBox1
l.AddRow path
l.Cell(l.LastIndex,1)=hex(flags)
l.Cell(l.LastIndex,2)=hex(eventID)
End EventHandler
End Class
End Project
See also:
The items on this page are in the following plugins: MBS MacFrameworks Plugin.