[pygtk] Scrolling to the previous position in a TreeView
Lionel Dricot
zeploum at gmail.com
Fri Jan 30 19:27:09 WST 2009
On Fri, Jan 30, 2009 at 11:06 AM, Walter Leibbrandt <walter at translate.org.za
> wrote:
> Hi,
>
> Lionel Dricot wrote:
>
>> So it works with :
>>
>> gobject.timeout_add(100,
>> self.task_tview.get_vadjustment().set_value,vscroll_value)
>>
>> The problem is that the delay is very noticable ! You see the content
>> jumping up and down and it's really ugly. A smaller delay (10) doesn't work
>> at all. 50 works but I believe that it might not work everywhere.
>>
> When I need to do a "do-this-a-bit-later" kind of call, I always try
> gobject.idle_add(func) first. With idle_add() the delay is only as long as
> it takes for the requests in the event queue to be processed (depending on a
> few things). No more and no less. It's usually less than any custom time-out
> value and not specific to the development machine.
>
> IMHO using idle_add() is already an ugly hack. Using timeout_add() (for
> things where specific time measurement is not involved) is even uglier and
> should be used with caution.
I perfectly agree. That's why I'm not satisfied with this solution. But, at
least, it works and I prefer having an ugly working code than a non
functionnal software.
More information about the pygtk
mailing list