Main index > Python programming > restarting a desklet

By mbokil (Desklet Author), on Wed Dec 21 21:53:55 2005: restarting a desklet.

Is it possible to call the restart function which appears on the context menu in a desklet? I saw there was a quit() function in the API but I didn't see a restart() function. I was thinking of switching the theme name in a desklet I was writing and then restarting the desklet directly after updating the configuration so the new theme appears.

-mark

By syfou (Core Developer & Desklet Author), on Wed Jan 18 16:16:20 2006.

There would be ugly hacks such as just calling the adesklets executable from within a script (do not forget about the ADESKLETS_MODE environment variable then), but I strongly discourage it.

I made quit() visible in the API simply because I cannot force people to write driver scripts that do not terminate, hence it is better to give them a clean way to stop them than nothing. As for restart(), I didn't expose it for the same reason I didn't expose window_move(): its an action only the user should provoke.

Hence, I advise you to write your desklet in such a way themes can be dynamically reset from the same context -- it is a little more work, but it will probably be cleaner at the end of the day too. Yours,


adesklets is proud to be hosted on:

SourceForge.net Logo

Back to adesklets.sf.net.