QtRuby: system tray

A

Andrew Lepyokhin

Hello, fellow rubyists!
I need an ability to hide my Qt-based app in tray and unhide it back :)
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
 
K

Ken Bloom

Hello, fellow rubyists!
I need an ability to hide my Qt-based app in tray and unhide it back :)
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.

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

--Ken
 
A

Andrew Lepyokhin

Ken said:
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:
 
S

Stefano Crocco

Alle Sunday 26 October 2008, Andrew Lepyokhin ha scritto:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top