Platforms to show: All Mac Windows Linux Cross-Platform

/MacOSX/Growl/Growl


Required plugins for this example: MBS Util Plugin, MBS MacOSX Plugin

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

This example is the version from Thu, 31th Jul 2019.

Project "Growl.xojo_binary_project"
FileTypes
Filetype text
End FileTypes
Class Window1 Inherits Window
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() if m.IsInstalled then MsgBox "Growl is installed." else MsgBox "Growl is not installed." end if End EventHandler
End Control
Control PushButton3 Inherits PushButton
ControlInstance PushButton3 Inherits PushButton
EventHandler Sub Action() if m.LaunchIfInstalled then MsgBox "Growl launched." else MsgBox "Growl failed." end if End EventHandler
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Control PushButton4 Inherits PushButton
ControlInstance PushButton4 Inherits PushButton
EventHandler Sub Action() dim s(0) as string s(0)="DefaultNotification" m.ApplicationName="ApplicationName" m.InstallationInformation="Installation Information" m.InstallationWindowTitle="Installation Window Title" m.UpdateInformation="Update Information" m.UpdateWindowTitle="Update Window Title" m.SetDefaultNotificationArray s m.SetAllNotificationArray s m.Register PushButton5.Enabled=true PushButton6.Enabled=true End EventHandler
End Control
Control PushButton5 Inherits PushButton
ControlInstance PushButton5 Inherits PushButton
EventHandler Sub Action() dim n as GrowlNotificationMBS n=new GrowlNotificationMBS n.Description="Just a little test notification." n.IsSticky=CheckBox1.Value n.Name="DefaultNotification" n.Priority=0 n.Title="Title of Notification" n.PostNotification // no event, so no need to store reference End EventHandler
End Control
Control StaticText4 Inherits Label
ControlInstance StaticText4 Inherits Label
End Control
Control StaticText5 Inherits Label
ControlInstance StaticText5 Inherits Label
End Control
Control CheckBox1 Inherits CheckBox
ControlInstance CheckBox1 Inherits CheckBox
End Control
Control PushButton6 Inherits PushButton
ControlInstance PushButton6 Inherits PushButton
EventHandler Sub Action() dim noti as MyGrowlNotificationMBS noti=new MyGrowlNotificationMBS noti.Description="Just a little test notification with event." noti.IsSticky=CheckBox1.Value noti.Name="DefaultNotification" noti.Priority=0 noti.Title="Title of Notification" noti.PostNotification // keep reference as the event needs somewhere to come to. End EventHandler
End Control
Control StaticText6 Inherits Label
ControlInstance StaticText6 Inherits Label
End Control
Control Framework Inherits Label
ControlInstance Framework Inherits Label
End Control
EventHandler Sub Open() dim f as FolderItem //Please make sure the GROWL frameworks is installed on your Desktop or /Library/Frameworks directory. m=new MyGrowlMBS f=FindFile("Growl.framework") if f<>nil and f.Exists then if m.LoadFramework(f) then Framework.text=f.NativePath Return end if end if // Local Library Folder f=DomainLibraryFolderMBS(-32765) if f<>Nil and f.Exists then f=f.Child("Frameworks") if f<>nil and f.Exists then f=f.Child("Growl.framework") if f<>nil and f.Exists then if m.LoadFramework(f) then Framework.text=f.NativePath Return end if end if end if end if // User Local Library Folder f=DomainLibraryFolderMBS(-32763) if f<>Nil and f.Exists then f=f.Child("Frameworks") if f<>nil and f.Exists then f=f.Child("Growl.framework") if f<>nil and f.Exists then if m.LoadFramework(f) then Framework.text=f.NativePath Return end if end if end if end if MsgBox "Failed to load framework." End EventHandler
Function FindFile(name as string) As FolderItem // Look for file in parent folders from executable on dim parent as FolderItem = app.ExecutableFile.Parent while parent<>Nil dim file as FolderItem = parent.Child(name) if file<>Nil and file.Exists then Return file end if parent = parent.Parent wend End Function
Property Protected m As myGrowlMBS
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 MyGrowlMBS Inherits GrowlMBS
EventHandler Sub Launched() MsgBox "Growl was launched as I got an event." End EventHandler
End Class
Class MyGrowlNotificationMBS Inherits GrowlNotificationMBS
EventHandler Sub Clicked() MsgBox "The notification was clicked and got its own event." End EventHandler
EventHandler Sub TimeOut() MsgBox "The notification had a timeout and got its own event." End EventHandler
End Class
End Project

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


The biggest plugin in space...