Next: Gnome2::PasswordDialog | Previous: Gnome2::PanelApplet::index | [Gtk2-Perl - Table of Contents] | [Gtk2-Perl - Index] |
Gnome2::PanelApplet
Glib::Object +----Glib::InitiallyUnowned +----Gtk2::Object +----Gtk2::Widget +----Gtk2::Container +----Gtk2::Bin +----Gtk2::EventBox +----Gnome2::PanelApplet
Glib::Object::_Unregistered::AtkImplementorIface Gtk2::Buildable
May croak with a Glib::Error in $@ on failure.
Depending on type, color or pixmap, or both, may be 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:
\&help_callback
[\&properties_callback, 'data']
sub { about_callback(@_) }
$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.
$opt_datadir (string or undef)
$file (string)
$opt_app_name (string or undef)
$verb_list (scalar)
$default_data (scalar)
'no-background' / 'PANEL_NO_BACKGROUND'
'color-background' / 'PANEL_COLOR_BACKGROUND'
'pixmap-background' / 'PANEL_PIXMAP_BACKGROUND'
'flags-none' / 'PANEL_APPLET_FLAGS_NONE'
'expand-major' / 'PANEL_APPLET_EXPAND_MAJOR'
'expand-minor' / 'PANEL_APPLET_EXPAND_MINOR'
'has-handle' / 'PANEL_APPLET_HAS_HANDLE'
'up' / 'PANEL_APPLET_ORIENT_UP'
'down' / 'PANEL_APPLET_ORIENT_DOWN'
'left' / 'PANEL_APPLET_ORIENT_LEFT'
'right' / 'PANEL_APPLET_ORIENT_RIGHT'
'tab-forward' / 'GTK_DIR_TAB_FORWARD'
'tab-backward' / 'GTK_DIR_TAB_BACKWARD'
'up' / 'GTK_DIR_UP'
'down' / 'GTK_DIR_DOWN'
'left' / 'GTK_DIR_LEFT'
'right' / 'GTK_DIR_RIGHT'
Copyright (C) 2003, 2007 by the gtk2-perl team.
This software is licensed under the LGPL. See Gnome2::PanelApplet for a full notice.