QtRuby: system tray

Hello, fellow rubyists!
I need an ability to hide my Qt-based app in tray and unhide it back :slight_smile:
I've read C examples at
http://doc.trolltech.com/4.2/desktop-systray.html
but couldn't understand it enough to translate it in ruby.
If someone has done this before or can explain how to use the above
example, please help me.

Andrew

ยทยทยท

--
Posted via http://www.ruby-forum.com/.

It's all about the QSystemTrayIcon class. Use the #hide and #show methods
to hide it and make it reappear.

--Ken

ยทยทยท

On Sun, 26 Oct 2008 06:42:49 -0500, Andrew Lepyokhin wrote:

Hello, fellow rubyists!
I need an ability to hide my Qt-based app in tray and unhide it back :slight_smile:
I've read C examples at
http://doc.trolltech.com/4.2/desktop-systray.html but couldn't
understand it enough to translate it in ruby. If someone has done this
before or can explain how to use the above example, please help me.

--
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/

Ken Bloom wrote:

It's all about the QSystemTrayIcon class. Use the #hide and #show
methods
to hide it and make it reappear.

Thank you, Ken, i started to get it, but here's a problem:
t = Qt::SystemTrayIcon.new
t.setIcon('icon.png')
results in error:
`method_missing': undefined method `setIcon' for #<Qt::SystemTrayIcon:

ยทยทยท

--
Posted via http://www.ruby-forum.com/\.

Alle Sunday 26 October 2008, Andrew Lepyokhin ha scritto:

Ken Bloom wrote:
> It's all about the QSystemTrayIcon class. Use the #hide and #show
> methods
> to hide it and make it reappear.

Thank you, Ken, i started to get it, but here's a problem:
t = Qt::SystemTrayIcon.new
t.setIcon('icon.png')
results in error:
`method_missing': undefined method `setIcon' for #<Qt::SystemTrayIcon:

setIcon requires a Qt::Icon, not the name of the icon file. You can do this:

t.setIcon(Qt::Icon.new('icon.png'))

You can also write this in a more rubish way:

t.icon = Qt::Icon.new('icon.png')

Stefano

Thank you, Stefano!
That worked!

ยทยทยท

--
Posted via http://www.ruby-forum.com/.