~ubuntu-branches/ubuntu/trusty/golang-dbus/trusty-proposed

« back to all changes in this revision

Viewing changes to _examples/notification.go

  • Committer: Package Import Robot
  • Author(s): Tianon Gravi
  • Date: 2014-04-22 23:04:32 UTC
  • Revision ID: package-import@ubuntu.com-20140422230432-7gapnr155keo1srw
Tags: upstream-1
ImportĀ upstreamĀ versionĀ 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package main
 
2
 
 
3
import "github.com/godbus/dbus"
 
4
 
 
5
func main() {
 
6
        conn, err := dbus.SessionBus()
 
7
        if err != nil {
 
8
                panic(err)
 
9
        }
 
10
        obj := conn.Object("org.freedesktop.Notifications", "/org/freedesktop/Notifications")
 
11
        call := obj.Call("org.freedesktop.Notifications.Notify", 0, "", uint32(0),
 
12
                "", "Test", "This is a test of the DBus bindings for go.", []string{},
 
13
                map[string]dbus.Variant{}, int32(5000))
 
14
        if call.Err != nil {
 
15
                panic(call.Err)
 
16
        }
 
17
}