maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   General (https://talk.maemo.org/forumdisplay.php?f=7)
-   -   update_widget() on desktop switch (https://talk.maemo.org/showthread.php?t=60866)

colchaodemola 2010-08-22 12:24

update_widget() on desktop switch
 
Hi guys , is there an event i can listen to make my widget update on desktop switching ?

btw, how can i get which signal/events are available ?

nicolai 2010-08-23 09:10

Re: update_widget() on desktop switch
 
Hi colchaodemola,

it would be better to ask those question in the development subforum.
Is your widget a QT or a hildon desktop widget?
If it is hildon, you can search the api doc:
http://maemo.org/api_refs/5.0/5.0-fi...tem.properties
To react on desktop switching connect to the notify event
for the is-on-current-desktop property.

regards
Nicolai

dchky 2010-08-23 11:09

Re: update_widget() on desktop switch
 
I would suggest you pick through the source code of swipecounter - it does exactly what you are looking for.

Available here

Venemo 2010-08-23 11:20

Re: update_widget() on desktop switch
 
Quote:

Originally Posted by colchaodemola (Post 794901)
Hi guys , is there an event i can listen to make my widget update on desktop switching ?

btw, how can i get which signal/events are available ?

YES, you can set up a gconf monitor.
You can specify a callback method, and it will call you back when the actual desktop has been changed.

You can checkout Sticky Notes to see how.

The actual relevant code is in this file. (Added to Sticky Notes via svn:externals.)

If you have questions about it, just ask.

Note that there is also a Qt-based gconf client in libqg. (Part of MAFW), though I preferred to use gconf directly.

colchaodemola 2010-08-23 12:29

Re: update_widget() on desktop switch
 
Quote:

Originally Posted by Venemo (Post 795715)
YES, you can set up a gconf monitor.
You can specify a callback method, and it will call you back when the actual desktop has been changed.

You can checkout Sticky Notes to see how.

The actual relevant code is in this file. (Added to Sticky Notes via svn:externals.)

If you have questions about it, just ask.

Note that there is also a Qt-based gconf client in libqg. (Part of MAFW), though I preferred to use gconf directly.

Any examples in Python ?
I am changing the sms_counter plugin ... and i am using EOP (Example oriented programming :P)

Venemo 2010-08-23 12:36

Re: update_widget() on desktop switch
 
Quote:

Originally Posted by colchaodemola (Post 795777)
Any examples in Python ?
I am changing the sms_counter plugin ... and i am using EOP (Example oriented programming :P)

Well, if you can interface Python with C libraries, it is most likely doable.
Anyways, it seems that there have been others who use gconf from Python code:
Here's your friend.


All times are GMT. The time now is 21:48.

vBulletin® Version 3.8.8