Re: threads and trayicon error

so the mistake in my code is use threads?I thought that maybe I used bad some function :\ I will try with this way (mentioned in the gtk2-perl faq), but it's weird that the trayicon changes good and after X (unknow) time crash and this icon becomes a line :\ with any reason

2008/9/30 Jörn Reder <joern zyn de>
anguila wrote:

> I use 2 threads, the first one, execute the to get the news, and
> the second wait $wait_time_error (the time acces to get the info from the
> web) to join the first thread for update the trayicon online or offline.

I'd suggest not using threads for this purpose... too complicated and
error-prone. It's not allowed to call Gtk+ functions outside the thread
which started the main loop, so you need to start a pure worker thread
communicating with the main thread to update the GUI etc.

You already have a separate process for the http stuff, so it's easy to
install an I/O watcher on your pipe and response to the events instead
of struggling with threads.

That's very common and you find an example for this in Gtk Perl docs,
e.g. here:

 [ 18. How do I keep my GUI updating while doing a long file read? ]



Think before you code. And while you're doing it probably won't hurt. ;)

gtk-perl-list mailing list
gtk-perl-list gnome org

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