Re: Problem setting icon for Gtk2::StatusIcon



One more thing.

When other programs are updating their notification icons in the
notification tray, it is smooth. When my program changes the icon, the
even if that succeeds, the whole tray blinks as if the tray had
received two signals:

1) remove item #x (refresh the whole tray)
2) add item #x (with a new icon; refresh the whole tray)

instead of:

0) change icon for item #x, refresh item #x only.

j.

On Mon, Mar 2, 2009 at 1:56 PM, January Weiner <january uni-muenster de> wrote:
Your script runs fine here, as is;

BTW what I forgot to mention is that I am using Ubuntu 8.10 with Gnome
2.24.1 and perl-gtk 1:1.183.1. The strange behaviour happens when I am
doing something in the foreground (like typing, clicking, moving
windows whatever).

BUT having a "sleep 5" in the main code
thread look awfully bad.  It's almost a rule.....do not use sleep in an event loop system,
like Gtk2.

The program is supposed to do something (some calculations) that takes
a few seconds. "sleep 5" simulates this. What I want to do is simple:
regularily call a sub that does the following:

1) toggle icon to "busy"
2) crunch, crunch, crunch calculate something
3) toggle icon to "ok" or "error" depending on the result

number (1) does not seem to work, I am not able to seamlessly toggle
two icons. This is strange, because I thought that calling
main_iterate repeatedly until there are no events pending should
assure that I have the "busy" icon visible *before* I start the
calculations.

You probably should change your timeout value to 5000, and have your callback
change the image (toggle) , and get rid of the sleep.

Hope I clarified it now. Sorry for not having added this explanation before.

j.




-- 
---------Dr. January Weiner 3  -----------------+-------------------
Inst. of Bioinformatics, UKM, Univ. of Muenster | Von-Esmarch-str. 54
(+49) (251) 83 53002                            | D48149 Münster
http://www.compgen.uni-muenster.de/             | Germany



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]