I had enough of it. Using the "Traybar" with my NotifyView was a pain in the a.. . I admit it - I'm guilty. So I decided to do it right this time.
My "US NotifyView" package contains a new and natural way to deal with NotifyArea Icons. No need to hassle with views. Simply create one (or many) instance(s) of NotifyAreaIcon and use simply messages like
Using NotifyAreaIcons also gives you two things which are IMHO not part of any other Dolphin Traybar goodie.
The following code illustrates it a bit more. Simply download the newest version of my goodies (04/23/2008) and enjoy.
My "US NotifyView" package contains a new and natural way to deal with NotifyArea Icons. No need to hassle with views. Simply create one (or many) instance(s) of NotifyAreaIcon and use simply messages like
#show
, #hide
, #icon:
and #message
. That's it. If you want events simply catch #leftButtonPressed
, #leftButtonDoubleClicked
, #rightButtonPressed
or #rightButtonDoubleClicked
.Using NotifyAreaIcons also gives you two things which are IMHO not part of any other Dolphin Traybar goodie.
- Survives Image Reload: If you save/close your image with visible Traybar icons they are restored if you reopen the image
- Explorer crash support: If your explorer crashes and rebuilds it's traybar your icons are re-added as well.
The following code illustrates it a bit more. Simply download the newest version of my goodies (04/23/2008) and enjoy.
| notifyIcon notifyIcons |
"Create your instance. No need to hassle with Views. Simply create an instance"
notifyIcon := NotifyAreaIcon
(Icon '!APPLICATION')
'My Application'.
"If you want your icon to be displayed, simply send #show"
notifyIcon .
"You can change the tip message and the icon any time by using #icon: and #message: .
If the icon is currently visible it's automatically updated."
notifyIcon
Icon .
notifyIcon 'Changed message'.
"You can use this i.e. to display animations"
Icon
[:each |
notifyIcon
each;
each ].
"The icon triggers several messages which you can intercept using the regular
#when:send:to: mechanism"
notifyIcon
#leftButtonPressed
#value
[Sound ].
notifyIcon
#leftButtonDoubleClicked
#value
[Sound .
(Delay 500)
.
Sound ].
notifyIcon
#rightButtonPressed
#value
[Sound ].
notifyIcon
#rightButtonDoubleClicked
#value
[Sound .
(Delay 500)
.
Sound ].
"If you don't need the icon anymore (e.g. during #onViewClosed) you can simply hide
it or nil the variable and let GC take care of it"
notifyIcon .
notifyIcon := nil.
""
"You can even generate a whole bunch of instances"
notifyIcons := Icon
[:each |
NotifyAreaIcon each
each ].
"If you want to stress test your system, show /all/ icons"
notifyIcons
[:each | each ].
"Please note, that we don't hide icons here. We simply nil the instance and let GC
take care of it"
notifyIcons := nil.
"You can also force a GC"
MemoryManager
1 comment:
Thats awesome - I really appreciate your work in helping the Dolphin community use the finer inner details of Windows without having to grapple with its complexity.
Tim
Post a Comment