Next:
Gnome2::PasswordDialog
Previous:
Gnome2::PanelApplet::index
 [Gtk2-Perl - Table of Contents][Gtk2-Perl - Index]

Gnome2::PanelApplet::main



NAME

Gnome2::PanelApplet

HIERARCHY

  Glib::Object
  +----Glib::InitiallyUnowned
       +----Gtk2::Object
            +----Gtk2::Widget
                 +----Gtk2::Container
                      +----Gtk2::Bin
                           +----Gtk2::EventBox
                                +----Gnome2::PanelApplet

INTERFACES

  Glib::Object::_Unregistered::AtkImplementorIface
  Gtk2::Buildable

METHODS

$applet->add_preferences ($schema_dir)

May croak with a Glib::Error in $@ on failure.

(type, color, pixmap) = $applet->get_background

Depending on type, color or pixmap, or both, may be undef.

flags = $applet->get_flags

$applet->set_flags ($flags)

orient = $applet->get_orient

string or undef = $applet->get_preferences_key

$applet->setup_menu ($xml, $verb_list, $default_data=undef)

This method sets up menu entries for your applet and binds them to callbacks. The XML for $xml needs to have the following format:

  <popup name="button3">
    <menuitem name="Properties Item"
              verb="Properties"
              _label="Properties ..."
              pixtype="stock"
              pixname="gtk-properties"/>
    <menuitem name="Help Item"
              verb="Help"
              _label="Help"
              pixtype="stock"
              pixname="gtk-help"/>
    <menuitem name="About Item"
              verb="About"
              _label="About ..."
              pixtype="stock"
              pixname="gnome-stock-about"/>
  </popup>

The verbs specified in this description can be mapped to callbacks in the $verb_list:

  $verb_list = {
    Properties => [\&properties_callback, 'data'],
    Help => \&help_callback,
    About => sub { about_callback(@_) },
  };

As you can see, the usual ways of specifying callbacks can be used:

o Bare code references as in \&help_callback
o Code references with data as in [\&properties_callback, 'data']
o Closures as in sub { about_callback(@_) }
If you use the first or last form, i.e. if you don't specify user data, the callback will be passed $default_data.

The callbacks will be passed three arguments: the bonobo component they belong to, the user data, and the verb they were installed for. Currently, the bonobo component will always be undef, since we have no bonobo Perl bindings yet.

$applet->setup_menu_from_file ($opt_datadir, $file, $opt_app_name, $verb_list, $default_data=undef)

integer = $applet->get_size

$applet->set_size_hints ($size_hints, $base_size)

SIGNALS

change-orient (Gnome2::PanelApplet, Glib::UInt)
change-size (Gnome2::PanelApplet, integer)
change-background (Gnome2::PanelApplet, Gnome2::PanelApplet::BackgroundType, Gtk2::Gdk::Color, Gtk2::Gdk::Pixmap)
move-focus-out-of-applet (Gnome2::PanelApplet, Gtk2::DirectionType)

ENUMS AND FLAGS

enum Gnome2::PanelApplet::BackgroundType

flags Gnome2::PanelApplet::Flags

enum Gnome2::PanelApplet::Orient

enum Gtk2::DirectionType

SEE ALSO

Gnome2::PanelApplet, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::Bin, Gtk2::EventBox

COPYRIGHT

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

This software is licensed under the LGPL. See Gnome2::PanelApplet for a full notice.


[Top] Generated by Marek::Pod::HTML 0.49 on Wed Dec 16 22:58:45 2009