Torsten Schönfeld > Gnome2-PanelApplet-0.03 > Gnome2::PanelApplet



Annotate this POD

View/Report Bugs
Module Version: 0.03   Source  


Gnome2::PanelApplet - Perl interface to GNOME's applet library


  # Initialize.
  Gnome2::Program->init ('My Applet', '0.01', 'libgnomeui'
                         sm_connect => FALSE);

  # Register our applet with that bonobo thingy.  The OAFIID stuff is
  # specified in a .server file.  See
  # C<examples/GNOME_PerlAppletSample.server> in the
  # I<Gnome2::PanelApplet> tarball for an example.
  Gnome2::PanelApplet::Factory->main (
    'OAFIID:PerlSampleApplet_Factory', # iid of the applet
    'Gnome2::PanelApplet',             # type of the applet
    \&fill                             # sub that populates the applet

  sub fill {
    my ($applet, $iid, $data) = @_;

    # Safety measure: if we're passed the wrong IID, just return.
    if ($iid ne 'OAFIID:PerlSampleApplet') {
      return FALSE;

    # Gnome2::PanelApplet isa Gtk2::EventBox, so it isa Gtk2::Container
    # in particular.  That means we can call add() on it.
    my $label = Gtk2::Label->new ('Hi, there!');
    $applet->add ($label);

    return TRUE;


Use Perl to write GNOME applets that sit on the panel.


Gnome2::PanelApplet::Factory->main is documented in Gnome2::PanelApplet::Factory. The methods you can call on the applet instance are documented in Gnome2::PanelApplet::main. The GConf helper functions are documented in Gnome2::PanelApplet::GConf.


Gnome2::PanelApplet::index, Gnome2, Gtk2, Gtk2::api and


Emmanuele Bassi <emmanuele.bassi at iol dot it>

Torsten Schoenfeld <kaffeetisch at gmx dot de>


Copyright (C) 2003, 2007 by the gtk2-perl team

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

syntax highlighting: