Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > QtRuby: system tray

Reply
Thread Tools

QtRuby: system tray

 
 
Andrew Lepyokhin
Guest
Posts: n/a
 
      10-26-2008
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
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Ken Bloom
Guest
Posts: n/a
 
      10-26-2008
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-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

--
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/
 
Reply With Quote
 
 
 
 
Andrew Lepyokhin
Guest
Posts: n/a
 
      10-26-2008
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/.

 
Reply With Quote
 
Stefano Crocco
Guest
Posts: n/a
 
      10-26-2008
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

 
Reply With Quote
 
Andrew Lepyokhin
Guest
Posts: n/a
 
      10-26-2008
Thank you, Stefano!
That worked!
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A System Tray Issue ( For some reason nothing but the date shows up in my system tray) Jer Computer Support 7 01-28-2007 07:48 AM
Losing quick launch tray and system tray golfer1029 Software 2 07-27-2006 10:24 AM
Minimize to taskbar/system tray Frunobulax Firefox 6 07-12-2006 04:32 AM
System Tray Signal Strength -vs- Wireless Properties Strength =?Utf-8?B?U2NvdHQ=?= Wireless Networking 3 04-07-2005 10:17 PM
problem of notification over system tray balu ASP .Net 1 12-18-2004 06:25 PM



Advertisments