Gtk2::TrayIcon(3pm)

Gtk2::TrayIcon3pm

Perl interface to the eggtrayicon library

Usage

  use Gtk2::TrayIcon;
  Gtk2->init;
  my $icon= Gtk2::TrayIcon->new("test");
  my $label= Gtk2::Label->new("test");
  $icon->add($label);
  $icon->show_all;
  Gtk2->main;

Abstract

This module allows a Perl developer to embed an arbitrary widget in a System Tray like the Gnome notification area.

Overview

EggTrayIcon is slated for inclusion in Gtk+ at some point, which is the reason the "Gtk2::TrayIcon" namespace. As all egg libs, EggTrayIcon is not considered api stable and its not installed as a shared object.

Enough about what it is not, "Gtk2::TrayIcon" is first and foremost a simple way of giving a Gtk2 script access to the system tray.

System Trays are found in both KDE and Gnome. But neither support the spec fully (see below).

"Gtk2::TrayIcon" is a subclass of "Gtk2::Plug" and should be used as such.

Methods

5 methods are available.

$trayicon= Gtk2::TrayIcon->new_from_screen($screen, $name)

This creates a widget already connected to the notification area of $screen. $screen should be a "Gtk::Gdk::Screen".

$trayicon= Gtk2::TrayIcon->new($name)

Like "new_from_screen" but uses the default screen of the active display.

$msgid= $trayicon->send_message($timeout, $message)

Ask the tray to display $message for $timeout milliseconds. If $timeout is 0, the message will not expire.

Note that it is up to the tray to decide what to do with the message both Gnome and KDE just ignores it.

$trayicon->cancel_message($msgid)

Ask the tray to cancel the message.

Releases

7 releases since Debian 3.1 (Sarge); the text changed 5 times.

  1. 3.1–4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8
  6. 9

Author

Christian Borup <gtk2-perl at borup dot com>

From libgtk2-trayicon-perl 0.06-2+b3 in Debian 9 (Stretch). Parsed by carta from the page's man source.