c++ - how to use sleep() in GTK+ -


i'm making app read cards , print balance, when user wants see balance clicks on balance enquiry button on main screen. i've created background using cairo. when user click balance enquiry screen showing show card should paused 2-3 seconds, i'm using sleep() function. problem screen sleeps on click on bal. enq. button, i'm sure sleep() after code prints show ur card on screen.

you can't use sleep() in gtk+ gui application, block entire application , make unresponsive. application causes gtk+ work update interface; if sleep, stop gtk+ running , ui changes won't happen until application wakes up.

look glib's timeout api: g_timeout_add() sensible place start.


Comments

Popular posts from this blog

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

php - Using str_replace to translate a MySQL Table in html -

asp.net mvc - Cannot display error message on Editor or EditorFor -