Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

/MacFrameworks/CoreWLAN Events
Required plugins for this example: MBS MacBase Plugin, MBS MacFrameworks Plugin, MBS Main Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacFrameworks/CoreWLAN Events
This example is the version from Sun, 17th Mar 2012.
Project "CoreWLAN Events.rbp"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control Listbox1 Inherits Listbox
ControlInstance Listbox1 Inherits Listbox
End Control
EventHandler Sub Open() // get an interface dim c as CWInterfaceMBS = CWInterfaceMBS.primaryInterface center = NSNotificationCenterMBS.defaultCenter if center = nil or center.Handle = 0 then MsgBox "Failed to get default notification center." Return end if addObserver(CWGlobalsMBS.kCWBSSIDDidChangeNotification) addObserver(CWGlobalsMBS.kCWCountryCodeDidChangeNotification) addObserver(CWGlobalsMBS.kCWLinkDidChangeNotification) addObserver(CWGlobalsMBS.kCWModeDidChangeNotification) addObserver(CWGlobalsMBS.kCWPowerDidChangeNotification) addObserver(CWGlobalsMBS.kCWSSIDDidChangeNotification) End EventHandler
Sub addObserver(name as string) dim o as new MyNSNotificationObserverMBS center.addObserver(o, name, nil) observer.Append o if o.Handle = 0 then MsgBox "Failed to create observer." Return end if End Sub
Property center As NSNotificationCenterMBS
Property observer() As MyNSNotificationObserverMBS
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
Class MyNSNotificationObserverMBS Inherits NSNotificationObserverMBS
EventHandler Sub GotNotification(notification as NSNotificationMBS) dim l as listbox = window1.Listbox1 l.AddRow Notification.name End EventHandler
End Class
End Project

Feedback, Comments & Corrections

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

MBS Xojo PDF Plugins