Sha256: e7a7bef2810d779665139e836a09204d6b7d2e9b80518faf336b43e918b5d068

Contents?: true

Size: 775 Bytes

Versions: 1

Compression:

Stored size: 775 Bytes

Contents

#!/usr/bin/env ruby

=begin

multi-actions.rb

Luca Russo <vargolo@gmail.com>
Copyright (LGPL) 2006 - 2011

ruby-libnotify multi-actions example

=end

begin
  require 'RNotify'
rescue LoadError
  require 'rubygems'
  require 'RNotify'
end

Gtk.init
Notify.init("Test4")

test = Notify::Notification.new("Test 4", "multi actions test", nil)
test.timeout= Notify::Notification::EXPIRES_NEVER
test.signal_connect("closed") { Gtk.main_quit }

test.add_action("Click Me action 1", "Click Me! - 1", "bye!! - 1") do |action, data|
  puts "#{action} - #{data}"
  Gtk.main_quit
end

test.add_action("Click Me action 2", "Click Me! - 2", "bye!! - 2") do |action, data|
  puts "#{action} - #{data}"
  Gtk.main_quit
end

test.show

Gtk.main

test.clear_actions
test.close
Notify.uninit

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-libnotify-0.5.0 examples/multi-actions.rb