# Rbw and backticks on windows + StatusIcon tooltip update?

**URL:** <https://www.ruby-forum.com/t/rbw-and-backticks-on-windows-statusicon-tooltip-update/103165>\
**Category:** Ruby-Gnome 2\
**Created:** [May 2, 2007, 4:51pm UTC](https://www.ruby-forum.com/t/rbw-and-backticks-on-windows-statusicon-tooltip-update/103165 "2007-05-02T16:51:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gergely\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/c77e96/32.png) [@Gergely\_K](https://www.ruby-forum.com/u/Gergely_K)\
**Post date:** [May 2, 2007, 4:51pm UTC](https://www.ruby-forum.com/t/rbw-and-backticks-on-windows-statusicon-tooltip-update/103165/1 "2007-05-02T16:51:31Z")

</div>

Hi!

I’ve tried StatusIcon. It works fine, but during this test, I’ve  
realized, that if I start the program with an rbw extension (no  
command window), it flashes if I invoke external command with  
backticks.

Is there any solution to that?

And is it possible to update the tooltip just in case I move the  
cursor over the status icon?

thanks

Gergo

Code follows:

require ‘gtk2’

class SubstIcon \< Gtk::StatusIcon  
def initialize  
super  
update  
signal\_connect(“popup-menu”){|w, button, activate\_time|  
menu = Gtk::Menu.new  
menuitem = Gtk::MenuItem.new(“Quit”)  
menuitem.signal\_connect(“activate”){  
set\_visible(false)  
Gtk.main\_quit  
}  
menu.append(menuitem)  
menu.show\_all  
menu.popup(nil, nil, button, activate\_time)  
}  
timeout\_func  
end  
def timeout\_func  
GLib::Timeout.add(1000) {  
update  
true  
}  
end  
def update  
set\_icon\_name(Gtk::Stock::DIALOG\_INFO)  
subst = `subst`.split(“\n”).  
find\_all {|l| l =~ /^S:\:/}.  
map{|l| /=\> .:\(.\*)/.match(l)[1]}[0] + “\n” +  
File.new(‘s:\varial\source\version.txt’).readline  
set\_tooltip subst  
end  
end  
SubstIcon.new

Gtk.main

–  
±[Gergely K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) ]------------------+  
| |  
| Mobile:(+36 20)356 9656 |  
| |  
± “Olyan lángész vagyok, hogy poroltóval kellene járnom!” -+

* * *

This [SF.net](http://SF.net) email is sponsored by DB2 Express  
Download DB2 Express C - the FREE version of DB2 express and take  
control of your XML. No limits. Just data. Click to get it now.  
[http://sourceforge.net/powerbar/db2/](http://sourceforge.net/powerbar/db2/)
