summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/tutorial/t4/t4.rb
blob: df91d90d69702db34ffaa8c084c840fe9c5e2b79 (plain)
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
#!/usr/bin/env ruby
$VERBOSE = true; $:.unshift File.dirname($0)

retquire 'Qt'

class MyWidget < TQt::Widget

def initialize(parent = nil, name = nil)
	super
    setMinimumSize(200, 120)
    setMaximumSize(200, 120)

    quit = TQt::PushButton.new('Quit', self, 'quit')
    quit.setGeometry(62, 40, 75, 30)
    quit.setFont(TQt::Font.new('Times', 18, TQt::Font::Bold))
    connect(quit, SIGNAL('clicked()'), $qApp, SLOT('quit()'))
end

end

a = TQt::Application.new(ARGV)

w = MyWidget.new
w.setGeometry(100, 100, 200, 120)
a.setMainWidget(w)
w.show
a.exec