You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdebindings/tqtruby/rubylib/examples/tqt-examples/hello/main.rb

24 lines
444 B

#!/usr/bin/env ruby
require 'TQt'
require 'hello'
a = TQt::Application.new(ARGV)
s = ''
s = ARGV[0..ARGV.size-1].join(' ') if ARGV.length
if (s.empty?)
s = 'Hello, World'
end
h = Hello.new(s)
h.setCaption('TQtRuby says hello')
h.connect(h, SIGNAL('clicked()'), a, SLOT('quit()'))
h.setFont(TQt::Font.new('times', 32, TQt::Font.Bold)) # default font
h.setBackgroundColor(TQt::white) # default bg color
a.setMainWidget(h)
h.show
a.exec