No subject
Mon Jan 19 19:02:15 WST 2009
looks like a pygtk/gtk bug/design flaw. If I set a value for the
adjustement, it should be done, not matter what. If waiting 100ms before
calling a function change your software's behaviour, I call that a bug.
Maybe there's something that I don't understand because I really believe
that going to a specific scroll position is a very common usecase. (but it
looks like the documentation on this part is very weak. Look at the
get_vadjustement which refers to set_vadjustement which, itself, just says :
"it set the adjustement" without explaining what an adjustement is)
Lionel
--0015174be21abba04f0461b0a5dc
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<br><br><div class=3D"gmail_quote">On Fri, Jan 30, 2009 at 11:06 AM, Walter=
Leibbrandt <span dir=3D"ltr"><<a href=3D"mailto:walter at translate.org.za=
">walter at translate.org.za</a>></span> wrote:<br><blockquote class=3D"gma=
il_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0=
pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<div class=3D"Ih2E3d"><br>
<br>
Lionel Dricot wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
So it works with :<br>
<br>
gobject.timeout_add(100, self.task_tview.get_vadjustment().set_value,vscrol=
l_value)<br>
<br>
The problem is that the delay is very noticable ! You see the content jumpi=
ng up and down and it's really ugly. A smaller delay (10) doesn't w=
ork at all. 50 works but I believe that it might not work everywhere.<br>
</blockquote></div>
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 cust=
om time-out value and not specific to the development machine.<br>
<br>
IMHO using idle_add() is already an ugly hack. Using timeout_add() (for thi=
ngs where specific time measurement is not involved) is even uglier and sho=
uld be used with caution.</blockquote><div><br>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.<br>
<br>From my point of view (which is very new and not well exeperienced), it=
looks like a pygtk/gtk bug/design flaw. If I set a value for the adjusteme=
nt, it should be done, not matter what. If waiting 100ms before calli=
ng a function change your software's behaviour, I call that a bug.<br>
<br>Maybe there's something that I don't understand because I reall=
y believe that going to a specific scroll position is a very common usecase=
. (but it looks like the documentation on this part is very weak. Loo=
k at the get_vadjustement which refers to set_vadjustement which, itself, j=
ust says : "it set the adjustement" without explaining what an ad=
justement is)<br>
<br><br>Lionel<br></div></div><br>
--0015174be21abba04f0461b0a5dc--
More information about the pygtk
mailing list