Detect GTK theme change in runtime

view full story

http://askubuntu.com – I am using this code to set appropriate appindicator icon for my application. Basically I set separate mono dark/light icon for Ambiance and Radiance theme in order to integrate my app into Unity desktop just like many other apps do. This works well, but what I noticed is that other apps (Tomboy, thunderbird...) update their appindicator icons immediately after the theme is changed. How do they do that? With my current implementation, I need to restart my app in order to get the right icon. (HowTos)