File: button2.rb

package info (click to toggle)
ruby-gnome2 3.1.0-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 16,072 kB
  • ctags: 17,433
  • sloc: ansic: 93,621; ruby: 62,273; xml: 335; sh: 246; makefile: 25
file content (28 lines) | stat: -rw-r--r-- 621 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/local/bin/ruby
=begin
  button2.rb - Ruby/GTK2 sample script.

  Copyright (c) 2002-2015 Ruby-GNOME2 Project Team
  This program is licenced under the same licence as Ruby-GNOME2.
=end

require "gtk3"

window = Gtk::Window.new("Gtk::Button sample")

button1 = Gtk::Button.new(:mnemonic => "_HELLO")
button2 = Gtk::Button.new(:label => "_HELLO")
button3 = Gtk::Button.new(:stock_id => Gtk::Stock::QUIT)  

button3.signal_connect("clicked"){ Gtk.main_quit }

box = Gtk::Box.new(:vertical)
box.add(button1)
box.add(button2)
box.add(button3)

window.add(box)
window.set_default_size(100,100)
window.show_all

Gtk.main