Active Topics

 


Reply
Thread Tools
Posts: 87 | Thanked: 26 times | Joined on Oct 2009
#1
Can someone help to understand why I can't to "scroll_to_child" after initialization.

got this example and modified it but no luck.
If the same function is called from button click, it is working
Can someone point to right direction

Attached python code:
Attached Files
File Type: txt jump.txt (2.5 KB, 78 views)
 
Posts: 87 | Thanked: 26 times | Joined on Oct 2009
#2
Hey

Figured it out, even there is that you should connect to 'realize' event, correct is 'map' event
 
Posts: 87 | Thanked: 26 times | Joined on Oct 2009
#3
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?
Attached Files
File Type: txt table.txt (2.8 KB, 82 views)
 
Posts: 53 | Thanked: 90 times | Joined on Nov 2009 @ Manaus, Brazil
#4
Originally Posted by nux View Post
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.
Attached Files
File Type: txt test_scroll.txt (940 Bytes, 66 views)
__________________
Anderson Lizardo
 

The Following 2 Users Say Thank You to lizardo For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 00:00.