Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Python Pannable Area scroll_to_child

    Reply
    nux | # 1 | 2010-01-16, 17:00 | Report

    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:

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Files
    File Type: txt jump.txt (2.5 KB, 76 views)

     
    nux | # 2 | 2010-01-16, 19:37 | Report

    Hey

    Figured it out, even there is that you should connect to 'realize' event, correct is 'map' event

    Edit | Forward | Quote | Quick Reply | Thanks

     
    nux | # 3 | 2010-01-17, 12:03 | Report

    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?

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Files
    File Type: txt table.txt (2.8 KB, 79 views)

     
    lizardo | # 4 | 2010-01-20, 15:40 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Files
    File Type: txt test_scroll.txt (940 Bytes, 64 views)
    The Following 2 Users Say Thank You to lizardo For This Useful Post:
    mbo, qwerty12

     
vBulletin® Version 3.8.8
Normal Logout