Recently on BeDevTalk, as a side-track from a discussion on the relevance of splash screens in our current favorite OS, there was some mention of a desire for a notification mechanism. It was expressed that there may be a need for a standard technique by which an application can get the user's attention. Presented for your enjoyment is an attempt at such a mechanism. This package provides, for the user, a single application which allows them to choose how they want to be notified of an application's need for interaction. Tools are provided for application developers to easily alert the user, when necessary, in the way the user has specified. Comments are encouraged.
Installation of the notification mechanism is trivial. Users should place the application named "Notification" in /boot/home/config/lib. For convenience, it makes sense to create a link to this application in /boot/home/config/be/preferences. By default, all forms of notification are turned on, so it's probably a good idea to run the app immediately to configure notification the way you want it. If you're a user, you're done.
The configuration window is pretty simple. Users can choose among 3 forms of notification. Coolest, and least obtrusive, is the placement in the deskbar of a notification menu. Any pending notifications show up as items in this menu, and selecting one of those items - rather than showing a window - will activate the application that's requesting the user's attention.
Your second choice is the option to have a sound played as part of the notification. You can choose any digital audio file that BeOS recognizes to let you know that some program needs your intervention.
The most obtrusive option is to have an alert pop up on the screen. It's not system-modal, so you can continue your other work.
Deinstallation primarily consists of deleting the "Notification" application. The configuration utility creates a single preference file: /boot/home/config/settings/notification_settings. You'll probably want to get rid of that, too, ifyou decide to remove the notification library. That's the only sneaky thing it does, though.
Taking advantage of this library in your own code is pretty simple. There's only one call. You can link against a shared library (the configuration app itself) or against a static library which simulates weak linking and provides a lightweight notification mechanism in case the shared lib can't be found. That second choice is recommended. Basically, what you want to do is link against whichever library you choose, using the header that accompanies it for your declarations. Any time you need the user's attention, call post_notification(). The user will receive a notification on your behalf, consistent with the settings that they've chosen. That's all there is to it. This package includes a sample application just in case you want to see it in action.
Copyright 1998, 1999, Bastion Products
Bastion Products and BeNotify are trademarks of Gregory Weston
BeBox and BeOS are trademarks of Be, Inc.