I'm trying to create a simple application indicator that mimics the CPU load applet for the gnome-panel.
I currently do this by updating (overwriting) the status icon of the indicator with the new CPU load information and re-set the status icon to the same icon on every update (I know this is stupid, but I don't know if it's currently possible to solve otherwise).
Unfortunately this doesn't work and I always see the "first" icon state, eg.
The indicator icon doesn't update, while the icon's content does.
I also tried to temporarily set the status icon to something else first, eg.
...
update_icon()
indicator.set_icon("indicator-messages")
indicator.set_icon("indicator-cpu-load")
...
but that didn't work either.
Any ideas?
UPDATE:
It is indeed possible to do what I wanted using a hack to cause the indicator to repaint its icon (thanks to Jorge Castro and Ted Gould):
...
update_icon()
indicator.set_status(appindicator.STATUS_ATTENTION)
indicator.set_status(appindicator.STATUS_ACTIVE)
...
The attention state icon should be the same as the active state icon, else there would be some flicker.