View Full Version : Python Pannable Area scroll_to_child
Can someone help to understand why I can't to "scroll_to_child" after initialization.
got this (http://wiki.maemo.org/PyMaemo/UITutorial/Navigation#Additional_features)example and modified it but no luck.
If the same function is called from button click, it is working :confused:
Can someone point to right direction :)
Attached python code:
Hey
Figured it out, even there is that you should connect to 'realize' event, correct is 'map' event :)
It seems that pannable area scrolling after initialize is not working if window is already visible.
Attached a sample code and if you uncomment line 61 it is not working anymore :(
But via button click then the same code is working.
And in both cases widget is maped and realized.
Can someone experience with python comment this?
lizardo
01-20-2010, 10:40 AM
It seems that pannable area scrolling after initialize is not working if window is already visible.
One possibility is that scroll_to_child() only works reliably after the event loop has started. You might use gobject.timeout_add() (or gobject.idle_add()) to add the scrolling as an asynchronous event.
I attached a (working) example showing how to use gobject.timeout_add(). In the example the pannable area scrolls to a random button every 2 seconds.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.