events - How to redraw gtk widget in python without calling gtk.main_iteration? -


my application have window handle key press events. when user press key run long tasks , during task update label on window. update label while task still running call following code. while gtk.events_pending(): gtk.main_iteration(false)

this update label problem process events including key presses. if user press key while tasks running calling main_iteration start processing task. want should update label other events should not processed . events should processed when task completed.

one way remove key press handler or in keypress handler check if task running ignore key presses in way keypresses lost. want somehow should update label leave other events , events should handled after task completed , application become idle. there way this?

thanks

you want .queue_draw() , related gtkwidget methods. note these mark widget needing redraw when main loop; don't think gtk+ has method drawing right now (but marking dirty , letting system redraw when it's ready better optimization reasons).


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -