.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Gtk2::AppIndicator 3pm" .TH Gtk2::AppIndicator 3pm "2014-08-15" "perl v5.20.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Gtk2::AppIndicator \- Perl extension for libappindicator .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use Gtk2 \*(Aq\-init\*(Aq; \& use Gtk2::AppIndicator; \& use Cwd; \& \& # Initialize the status icon. an_icon_name must be present \& # at the icon theme path location, with an image extension like \& # .jpg, .png or .svg, etc. \& $status_icon=Gtk2::AppIndicator\->new("AnAppName","an_icon_name"); \& \& # If you want to be in control over your icon location, you \& # can set it manually. It must be an absolute path, in order \& # to work. \& my $absolute_current_working_directory=getcwd(); \& my $acwd=$absolute_current_working_directory; \& $status_icon\->set_icon_theme_path($acwd); \& \& # Optionally set different icons \& # $status_icon\->set_icon_name_active("an_icon_name"); \& # $status_icon\->set_icon_name_attention("an_other_icon_name"); \& # $status_icon\->set_icon_name_passive("an_other_icon_name"); \& \& # Add a menu to the indicator \& my $menu=Gtk2::Menu\->new(); \& my $showcp=Gtk2::CheckMenuItem\->new_with_mnemonic("_Show My App"); \& $showcp\->set_active(1); \& $showcp\->signal_connect("toggled",sub { hide_show($window,$showcp); }); \& my $quit=Gtk2::MenuItem\->new_with_mnemonic("_Quit"); \& $quit\->signal_connect("activate",sub { Gtk\->main_quit(); }); \& \& $menu\->append($showcp); \& $menu\->append(Gtk2::SeparatorMenuItem\->new()); \& $menu\->append($quit); \& $status_icon\->set_menu($menu); \& \& # Show our icon and set the state \& $menu\->show_all(); \& $status_icon\->set_active(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module gives an interface to the new ubuntu Unity libappindicator stuff. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .Vb 1 \& $ind=Gtk2::AppIndicator\->new($application_id,$active_icon_name [,$category]) .Ve .PP Creates a new application indicator object with given name (id) and icon name for the active icon. Category must be one of { 'application\-status', 'communications', 'system\-services', 'hardware', 'other' } if set. if not set, it defaults to 'application\-status'. .PP .Vb 1 \& $ind\->set_icon_theme_path($path) .Ve .PP Set the icon theme path to 'path'. This is where icons should be found with names like .png. .PP .Vb 1 \& $ind\->get_icon_theme_path() .Ve .PP Returns the (previously written) icon theme path, or undefined if not set. .PP .Vb 1 \& $ind\->get_category() .Ve .PP Returns the previously set category with the new function. .PP .Vb 1 \& $ind\->get_id() .Ve .PP Returns the application id given to the new function. .PP .Vb 1 \& $ind\->set_icon_name_active($name) .Ve .PP Sets the icon name for the active icon. .PP .Vb 1 \& $ind\->get_icon_name_active() .Ve .PP Returns the name of the icon for active state. .PP .Vb 1 \& $ind\->set_icon_name_attention($name) .Ve .PP Sets the icon name for the attention icon .PP .Vb 1 \& $ind\->get_icon_name_attention() .Ve .PP Returns the name of the icon for attention state. .PP .Vb 1 \& $ind\->set_active() .Ve .PP Makes the application indicator active. .PP .Vb 1 \& $ind\->set_attention() .Ve .PP Makes the application indicator show the attention icon. .PP .Vb 1 \& $ind\->set_passive() .Ve .PP Makes the application indicator enter passive state, not showing any icon .PP .Vb 1 \& $ind\->set_state($state) .Ve .PP Sets application indicator in the given state, one of {'active','passive','attention'}. .PP .Vb 1 \& $ind\->get_state() .Ve .PP Returns the current state of the application indicator. .PP .Vb 1 \& $ind\->set_menu($menu) .Ve .PP Sets the popup menu for the indicator icon. .PP .Vb 1 \& $ind\->get_menu() .Ve .PP Returns the current menu (not from the C code, but as stored in the perl object) .PP .Vb 1 \& $ind\->set_secondary_activate_target($widget) .Ve .PP Sets the secondary active target (under the middle mouse button) to \f(CW$widget\fR .PP .Vb 1 \& $ind\->get_secondary_activate_target() .Ve .PP Returns the current secondary active target (not from the C code, but as stored in the perl object) .SH "AUTHOR" .IX Header "AUTHOR" Hans Oesterholt, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2012 by Hans Oesterholt .PP This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License, which comes with Perl.