Re: Does Glib::usleep work on GUI (Gtkmm) app?



On Fri, 2011-08-26 at 22:35 +0800, Mj Mendoza IV wrote:
> Hi all,
> 
> 
> I have a Gtkmm app that requires SLEEP command to display a sequence
> of images (Cairo Context).

how does a sleep command display a sequence of images?  this is very
confusing.

> I called Glib::usleep(1000) and expected a one-second delay but
> nothing. Tried higher number (3000, 5000), still nothing.

usleep() takes a value in microseconds.  So 1000 is equal to 1ms, not
1s.

But regardless, it's rarely appropriate to use Glib::usleep().  Sleeping
in a gtkmm app will make your UI completely unresponsive until the sleep
is finished (e.g. unable to close the app, unable to click any menus,
etc).  If you can explain what you're trying to achieve, we might be
able to suggest a better approach.

jonner



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