Gtk2::TrayManager(3pm)

Gtk2::TrayManager3pm

Perl bindings for eggtraymanager

Usage

        use Gtk2 -init;
        use Gtk2::TrayManager;
        my $screen = Gtk2::Gdk::Screen->get_default;
        if (Gtk2::TrayManager->check_running($screen)) {
                print STDERR "A tray manager is already running, sorry!\n";
                exit 256;
        }
        my $tray = Gtk2::TrayManager->new;
        $tray->manage_screen($screen);
        $tray->set_orientation('vertical');
        $tray->signal_connect('tray_icon_added', sub {
                # $_[1] is a Gtk2::Socket
        });
        $tray->signal_connect('tray_icon_removed', sub {
                # $_[1] is a Gtk2::Socket
        });

Abstract

The EggTrayManager library is used internally by GNOME to implement the server-side of the Notification Area (or system tray) protocol. Gtk2::TrayManager allows you to create notification area applications using Gtk2-Perl.

Methods

        $running = Gtk2::TrayManager->check_running($screen);

This method returns a boolean value indicating whether another program is already managing notifications for the given Gtk2::Gdk::Screen. If this method returns a false value, then you should give way to the application that is already running.

        $tray = Gtk2::TrayManager->new;

This creates a tray manager object.

        $tray->manage_screen($screen);

This tells the tray to manage notifications for the Gtk2::Gdk::Screen referenced by $screen.

        $tray->set_orientation($orientation);

This method tells the tray whether icons are to be arranged vertically or horizontally. $orientation may be either '"vertical"' or '"horizontal"'.

        $title = $tray->get_child_title($child);

This method returns a string containing the title of the icon defined by $child.

Signals

"tray_icon_added"

Emitted when a client plug (eg one created by Gtk2::TrayIcon) wants to connect. For callbacks connected to this signal, @_ will have the form

        @_ = (
                bless( {}, 'Gtk2::TrayManager' ),
                bless( {}, 'Gtk2::Socket' )
        );
"tray_icon_added"

Emitted when a client plug has disconnected. For callbacks connected to this signal, @_ will have the form

        @_ = (
                bless( {}, 'Gtk2::TrayManager' ),
                bless( {}, 'Gtk2::Socket' )
        );
"message_sent", "message_removed"

The Freedesktop.org specification includes support for "balloon messages", but these are not currently implemented in EggTrayManager.

"lost_selection"

As a rule, compliant applications should check to for an already running manager, and give way to it if it finds one. However, it is possible that your application might have its X selection forcibly removed; this signal is emitted if this should happen.

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 <borup at cpan dot org>. Nagging and documentation by Gavin Brown <[email protected]>

From libgtk2-traymanager-perl 0.05-3+b3 in Debian 9 (Stretch). Parsed by carta from the page's man source.