QtRuby: system tray

Discussion in 'Ruby' started by Andrew Lepyokhin, Oct 26, 2008.

  1. Andrew Lepyokhin, Oct 26, 2008
    #1
    1. Advertising

  2. Andrew Lepyokhin

    Ken Bloom Guest

    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/
     
    Ken Bloom, Oct 26, 2008
    #2
    1. Advertising

  3. 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/.
     
    Andrew Lepyokhin, Oct 26, 2008
    #3
  4. 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
     
    Stefano Crocco, Oct 26, 2008
    #4
  5. Andrew Lepyokhin, Oct 26, 2008
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. balu
    Replies:
    1
    Views:
    627
    Peter Jausovec
    Dec 18, 2004
  2. Manish Hatwalne

    Re: show icon in system tray?

    Manish Hatwalne, Jul 15, 2003, in forum: Java
    Replies:
    1
    Views:
    441
    Joona I Palaste
    Jul 15, 2003
  3. Eugene Toporov

    Re: show icon in system tray?

    Eugene Toporov, Jul 15, 2003, in forum: Java
    Replies:
    0
    Views:
    383
    Eugene Toporov
    Jul 15, 2003
  4. Chandler

    Hide in System Tray

    Chandler, Sep 30, 2003, in forum: Java
    Replies:
    3
    Views:
    452
    Chandler
    Sep 30, 2003
  5. dushkin

    System tray message

    dushkin, Feb 5, 2006, in forum: Java
    Replies:
    5
    Views:
    4,365
    Roedy Green
    Feb 6, 2006
Loading...

Share This Page