Re: automated scrolling..?!



On 5/15/06, shree nidhi <shree_poroly yahoo com> wrote:

Hello all,
            I am using GTK+2.0, i just wanna animate the scroll
movement,i.e,automatically from left to right.i have placed a drawing area
widget in the box . i am able to move the scroll but i am not able to see
any data or signal and rulers, but when it stops finally i could see the
data which has been moved to that point!!. i am doing this by using a for
loop. In the for loop what i did is just keep on changing the adjX
value(incrementing).

The for-loop prevents the GTK+ main loop from handling the update
events, so no updating will happen. On way is to do this inside the
for-loop

while (gtk_events_pending())
 {
    gtk_main_iteration ();
 }

but this is not as nice as using g_timeout_add() or even g_idle_add()
for implementing animation.

Generally speaking, running the main loop by hand brings more problems
than solutions, so one should always use g_timout_add() or similar
mainloop integration to implement this kind of constant updates.

--
Kalle Vahlman, zuh iki fi
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]