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

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -