Re: Problem setting icon for Gtk2::StatusIcon



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.



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