---
name: "Gtk2::Notify"
section: "3pm"
platform: "linux"
package: "libgtk2-notify-perl"
version: "0.05-4+b3"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/Gtk2::Notify"
---

# Gtk2::Notify(3pm)

Perl interface to libnotify

## NAME

Gtk2::Notify - Perl interface to libnotify

## HIERARCHY

```
  Glib::Object
  +----Gtk2::Notify
```

## SYNOPSIS

```
    use Gtk2::Notify -init, "app_name";
    my $notification = Gtk2::Notify->new(
            $summary,
            $message,
            $icon,
            $attach_widget
    );
    $notification->show;
```

## INITIALISATION

```
    use Gtk2::Notify qw/-init app_name/;
```

- \-init

  Importing Gtk2::Notify with the -init option requires one additional argument: the application name to use. This is equivalent to `"Gtk2::Notify->init($app_name)"`.

## METHODS

### notify = Gtk2::Notify-\>new ($summary, $body=undef, $icon=undef)

- •

  `$summary` (string)

- •

  `$body` (string)

- •

  `$icon` (string)

### $notification-\>add\_action ($action, $label, $callback, $userdata=undef)

- •

  `$action` (string)

- •

  `$label` (string)

- •

  `$callback` (scalar)

- •

  `$userdata` (scalar)

### string = Gtk2::Notify-\>get\_app\_name

### $notification-\>set\_category ($category)

- •

  `$category` (string)

### $notification-\>clear\_actions

### $notification-\>clear\_hints

### notify = $notification-\>close

### $notification-\>set\_hint\_byte\_array ($key, $value)

- •

  `$key` (string)

- •

  `$value` ((unknown))

### $notification-\>set\_hint\_byte ($key, $value)

- •

  `$key` (string)

- •

  `$value` (Glib::UChar)

### $notification-\>set\_hint\_double ($key, $value)

- •

  `$key` (string)

- •

  `$value` (double)

### $notification-\>set\_hint\_int32 ($key, $value)

- •

  `$key` (string)

- •

  `$value` (integer)

### $notification-\>set\_hint ($key, $value)

- •

  `$key` (string)

- •

  `$value` (scalar)

### $notification-\>set\_hint\_string ($key, $value)

- •

  `$key` (string)

- •

  `$value` (string)

### $notification-\>set\_icon\_from\_pixbuf ($icon)

- •

  `$icon` (Gtk2::Gdk::Pixbuf)

### boolean = Gtk2::Notify-\>init ($app\_name)

- •

  `$app_name` (string)

### boolean = Gtk2::Notify-\>is\_initted

### list = Gtk2::Notify-\>get\_server\_caps

### (notify, name, vendor, version, spec\_version) = Gtk2::Notify-\>get\_server\_info

### notify = $notification-\>show

### $notification-\>set\_timeout ($timeout)

- •

  `$timeout` (integer)

### Gtk2::Notify-\>uninit

### boolean = $notification-\>update ($summary, $message=undef, $icon=undef)

- •

  `$summary` (string)

- •

  `$message` (string)

- •

  `$icon` (string)

### $notification-\>set\_urgency ($urgency)

- •

  `$urgency` (Gtk2::Notify::NotifyUrgency)

## PROPERTIES

- 'app-name' (string : default undef : readable / writable)

  The application name to use for this notification

- 'body' (string : default undef : readable / writable / construct)

  The message body text

- 'closed-reason' (integer : default -1 : readable)

  The reason code for why the notification was closed

- 'icon-name' (string : default undef : readable / writable / construct)

  The icon filename or icon theme-compliant name

- 'id' (integer : default 0 : readable / writable / construct)

  The notification ID

- 'summary' (string : default undef : readable / writable / construct)

  The summary text

## SIGNALS

- **closed** (Gtk2::Notify)

  ## ENUMS AND FLAGS

### enum Gtk2::Notify::NotifyUrgency

- •

  'low' / 'NOTIFY\_URGENCY\_LOW'

- •

  'normal' / 'NOTIFY\_URGENCY\_NORMAL'

- •

  'critical' / 'NOTIFY\_URGENCY\_CRITICAL'

## BUGS

Please report any bugs or feature requests to `"bug-gtk2-notify at rt.cpan.org"`, or through the web interface at \<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Gtk2-Notify\>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

## SUPPORT

You can find documentation for this module with the perldoc command.

```
    perldoc Gtk2::Notify
```

You can also look for information at:

- •

  AnnoCPAN: Annotated CPAN documentation

  \<http://annocpan.org/dist/Gtk2-Notify\>

- •

  CPAN Ratings

  \<http://cpanratings.perl.org/d/Gtk2-Notify\>

- •

  RT: CPAN's request tracker

  \<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Gtk2-Notify\>

- •

  Search CPAN

  \<http://search.cpan.org/dist/Gtk2-Notify\>

## SEE ALSO

Gtk2::Notify, Glib::Object

## COPYRIGHT

Copyright (C) 2006-2008 by Florian Ragwitz
