[Kde-bindings] QtRuby Hello World
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Sun Jul 13 14:43:48 UTC 2003
Holy Smoke!! I've got my first QtRuby program working:
#!/usr/bin/ruby -w
require 'Qt';
a = Qt::Application.new(ARGV, ref nil);
hello = Qt::PushButton.new("Hello World!", nil)
hello.resize(100, 30)
a.setMainWidget(hello)
hello.show()
a.exec()
Now it can actually do something, it's got to the fun stage..
Calling a method in Smoke means nearly everything has to work - marshalling,
C++ <--> ruby instance managment - so I can't see any major problems with
finishing it off now.
The original RubyQt bindings left the classnames as 'QWidget' rather than
'Qt::Widget', so existing code wouldn't be compatible - I don't know if that
matters. And do ruby programmers prefer to have method names in lower
case/underscores rather than mixed case (I'd personally prefer to leave the
names as they are)?
-- Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qtruby_0.3.tar.gz
Type: application/x-tgz
Size: 31503 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20030713/79fd7f7c/attachment.bin>
More information about the Kde-bindings
mailing list