[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

QtRuby: system tray

Andrew Lepyokhin

10/26/2008 11:43:00 AM

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-sy...
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-....

4 Answers

Ken Bloom

10/26/2008 5:14:00 PM

0

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 :)
> I've read C examples at
> http://doc.trolltech.com/4.2/desktop-sy... 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

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

Andrew Lepyokhin

10/26/2008 7:15:00 PM

0

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-....

Stefano Crocco

10/26/2008 7:23:00 PM

0

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

Andrew Lepyokhin

10/26/2008 7:29:00 PM

0

Thank you, Stefano!
That worked!
--
Posted via http://www.ruby-....