TrayIcon(3)

πŸ“¦
version 0.07 Β· 2 versions
, in fedora 43

πŸ’– Gtk2::TrayIcon β€” TrayIcon(3) πŸ’–

okay so bestie, welcome to the TrayIcon(3) page, straight out of the User Contributed Perl Documentation collection. sit down, grab a strawberry πŸ“, because this one is a whole journey β€” and I mean that in the "the vibes are complicated" way, not the "slay" way. no cap.


✨ NAME ✨

Gtk2::TrayIcon β€” (DEPRECATED) Perl interface to the EggTrayIcon library

yeah. DEPRECATED. right there in the name. we'll get into it. πŸ™ˆ


✨ SYNOPSIS ✨

here's the whole vibe in code form, verbatim, don't touch a single character:

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;

make a tray icon, slap a label on it, show it, run the main loop. iconic behavior, honestly. πŸ‘‘


✨ ABSTRACT ✨

DEPRECATED β€” this module lets a Perl developer embed an arbitrary widget in a System Tray, like the Gnome notification area. that's the dream. that's the whole point of her existence. πŸ’…


✨ DESCRIPTION ✨

NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE

okay so this is the part where I have to be real with you. 😭

This module has been deprecated by the Gtk-Perl project. and what that means, fr fr, is:

  • it will no longer be updated with security patches
  • no bug fixes
  • no updates when changes are made in the Perl ABI

the Git repo for this module has been archived (made read-only), and it will no longer be possible to submit new commits to it. bestie it's giving "frozen in amber." πŸ¦‹

you're more than welcome to ask about this module on the Gtk-Perl mailing list, but the priorities going forward are maintaining Gtk-Perl modules that are supported and maintained upstream β€” and this module is neither.

since this module is licensed under the LGPL v2.1, you may also fork it if you wish β€” but listen, there are conditions:

  • you'll need to use a different name for it on CPAN
  • the Gtk-Perl team requests that you use your own resources (mailing list, Git repos, bug trackers, etc.) to maintain your fork going forward

here's the whole info dump, laid out pretty:

NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE

okay phew, back to the lore. πŸ“–

EggTrayIcon is slated for inclusion in Gtk+ at some point β€” which is literally the whole reason it lives in the Gtk2::TrayIcon namespace. and like all egg libs, EggTrayIcon is not considered api stable and it's not installed as a shared object. so. that's the situation. πŸ™ƒ

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

System Trays are found in both KDE and Gnome β€” but heads up, neither supports the spec fully (see below πŸ‘€).

and one more thing: Gtk2::TrayIcon is a subclass of Gtk2::Plug and should be used as such. iykyk. 🫢


✨ METHODS ✨

5 methods are available. (yes bestie, she says 5 and then lists four β€” we don't make the rules, we just report them 😭)

  • $trayicon= Gtk2::TrayIcon->new_from_screen($screen, $name) β€” creates a widget that's already connected to the notification area of $screen. and $screen should be a Gtk::Gdk::Screen. πŸ–₯️
  • $trayicon= Gtk2::TrayIcon->new($name) β€” like new_from_screen, but it uses the default screen of the active display instead. easy mode. ✨
  • $msgid= $trayicon->send_message($timeout, $message) β€” asks the tray to display $message for $timeout milliseconds. if $timeout is 0, the message will not expire. ⏳
    • > heads up: it is up to the tray to decide what to do with the message β€” both Gnome and KDE just ignore it. πŸ’€
  • $trayicon->cancel_message($msgid) β€” asks the tray to cancel the message. that's it. that's the method. 🌸

✨ SEE ALSO ✨

Glib, Gtk2, and The System Tray Spec at http://www.freedesktop.org/Standards/systemtray-spec. 🌈


✨ AUTHOR ✨

Christian Borup <gtk2-perl at borup dot com> πŸ’œ


Copyright 2003 by the gtk2-perl team.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU Library General Public License for more details. 😀

You should have received a copy of the GNU Library General Public License along with this library; if not, see <https://www.gnu.org/licenses/>.


and that's the page, bestie!! πŸŽ€ this was perl v5.42.0, dated 2025-07-25, and it's the TrayIcon(3) manual page. go forth, migrate to Gtk3::StatusIcon, and stay iconic. πŸ’–βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from