1TrayIcon(3) User Contributed Perl Documentation TrayIcon(3)
2
3
4
6 Gtk2::TrayIcon - Perl interface to the EggTrayIcon library
7
9 use Gtk2::TrayIcon;
10 Gtk2->init;
11
12 my $icon= Gtk2::TrayIcon->new("test");
13 my $label= Gtk2::Label->new("test");
14 $icon->add($label);
15 $icon->show_all;
16
17 Gtk2->main;
18
20 This module allows a Perl developer to embed an arbitrary widget in a
21 System Tray like the Gnome notification area.
22
24 EggTrayIcon is slated for inclusion in Gtk+ at some point, which is the
25 reason the "Gtk2::TrayIcon" namespace. As all egg libs, EggTrayIcon is
26 not considered api stable and its not installed as a shared object.
27
28 Enough about what it is not, "Gtk2::TrayIcon" is first and foremost a
29 simple way of giving a Gtk2 script access to the system tray.
30
31 System Trays are found in both KDE and Gnome. But neither support the
32 spec fully (see below).
33
34 "Gtk2::TrayIcon" is a subclass of "Gtk2::Plug" and should be used as
35 such.
36
38 5 methods are available.
39
40 $trayicon= Gtk2::TrayIcon->new_from_screen($screen, $name)
41 This creates a widget already connected to the notification area of
42 $screen. $screen should be a "Gtk::Gdk::Screen".
43
44 $trayicon= Gtk2::TrayIcon->new($name)
45 Like "new_from_screen" but uses the default screen of the active
46 display.
47
48 $msgid= $trayicon->send_message($timeout, $message)
49 Ask the tray to display $message for $timeout milliseconds. If
50 $timeout is 0, the message will not expire.
51
52 Note that it is up to the tray to decide what to do with the
53 message both Gnome and KDE just ignores it.
54
55 $trayicon->cancel_message($msgid)
56 Ask the tray to cancel the message.
57
59 Glib, Gtk2 and The System Tray Spec
60 http://www.freedesktop.org/Standards/systemtray-spec.
61
63 Christian Borup <gtk2-perl at borup dot com>
64
66 Copyright 2003 by the gtk2-perl team.
67
68 This library is free software; you can redistribute it and/or modify it
69 under the terms of the GNU Library General Public License as published
70 by the Free Software Foundation; either version 2 of the License, or
71 (at your option) any later version.
72
73 This library is distributed in the hope that it will be useful, but
74 WITHOUT ANY WARRANTY; without even the implied warranty of
75 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
76 Library General Public License for more details.
77
78 You should have received a copy of the GNU Library General Public
79 License along with this library; if not, write to the Free Software
80 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307
81 USA.
82
83
84
85perl v5.28.0 2007-05-14 TrayIcon(3)