File: test.rb

package info (click to toggle)
ruby-gnome2 0.12.0-2sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 6,820 kB
  • ctags: 7,421
  • sloc: ansic: 61,387; ruby: 17,307; makefile: 85; xml: 35; sql: 13
file content (16 lines) | stat: -rw-r--r-- 377 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'gtk2'
require 'gconf2'

Gtk.init

client = GConf::Client.default
window = Gtk::Window.new
str = client.get "/apps/gnome-cd/device"
label = Gtk::Label.new(str ? str : '<unset>')
window.add label
client.add_dir "/apps/gnome-cd"
client.notify_add "/apps/gnome-cd/device" do |client, entry|
	label.text = entry.value ? entry.value : '<unset>'
end
window.show_all
Gtk.main