NAME
SystemTray::Applet - OS agnostic system tray applets
VERSION
Version 0.02
SYNOPSIS
This code wraps existing gui toolkits and lets you create a system tray applet that doesn't require knowledge of the users toolkit.
use SystemTray::Applet;
my $foo = SystemTray::Applet->new("text" => "hello world");
FUNCTIONS
new
$applet = SystemTray::Applet->new( "text" => "hello world" );
This method looks for the highest priority plugin under the SystemTray::Applet namespace and passes the plugin name and any arguments passed in to create. This allows developers to use SystemTray::Applet to construct one of its system specific subclasses without knowing which ones may be installed.
If no plugins are found or object construction fails undef is returned.
create
$applet = System::Tray::Applet::CmdLine->create( "text" => "hello world" );
This method is the SystemTray applet constructor. It should not be called directly. It should be called via SystemTray::Applet->new or as a subclasses constructor e.g. SystemTray::Applet::Create->create();
The following arguments can be passed as name value pairs
- icon - name of a file to use as applet icon
- text - text to display in applet or as hover text if an icon is supplied
- callback - function to update the icon and text over time
- frequency - how often in seconds to call the callback function
- immediate - if true the callback is called on object creation , usually you need to wait frequency seconds
Note : The callback does not need to call $self->display() or $self->schedule() as the module takes care of that.
If the object can not be constucted undef is returned.
init
$self->init();
Subclass specific init method for object initialization.
This should not be call directly as it is only used by system specific subclasses.
This should return true in subclasses.
icon
$self->icon("foo.ico");
This method sets the objects icon by calling the system specific create icon method in the subclass
create_icon
$self->create_icon();
Subclass specific create_icon method for creating an icon class used by the system specific gui code.
This should not be called directly as it is only provided by the system specific subclass.
display
$self->display();
Subclass specific display method for updating the GUI representation of the applet.
This should not be called directly as it is only provided by the system specific subclass.
schedule
$self->schedule();
Subclass specific schedule method for scheduling the callback.
This should not be called directly as it is only provided by the system specific subclass.
start
$self->start();
Subclass specific method for starting the gui up. This never returns.
AUTHOR
Peter Sinnott, <psinnott at cpan.org>
BUGS
Please report any bugs or feature requests to bug-systemtray-applet at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SystemTray-Applet. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc SystemTray::Applet
You can also look for information at:
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Copyright 2008 Peter Sinnott, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.