pygtk - Gtk3 appIndicator - update icon/text without user input -


so have python script sync's files nas every x minutes. trying write app indicator (ubuntu) follow process of above script.

if embed indicator code script , use glib.timeout_add(10, handler_timeout) indicator cannot updated until sync done - i.e see layout below:

*

setupindicator() sync():     update app indicastor syncing     sync nas - takes 5mins     update app indicator - sync comlplete glib.timeout_add(30minutes, self.sync) gtk.main() 

*

this want of course doesn't work this. trouble don't know go here - how can achieve this?

i think need put nas functionality thread , thread kicked off @ each update.

the first/last thing thread update indicator busy/idle.

i've written appindicator (python 3, gtk+ 3) ubuntu called indicator-ppa-download-statistics, found here implements similar concept (i understand) want. i'm not sure if you'd need use locking mechanism or global flag i've used in instance, @ least threaded approach allow nas stuff happen in background without blocking indicator being used user.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -