loadmodule "luaiup" gauge = iup.gauge { show_text = "YES" } dlg = iup.dialog{gauge, title = "IupGauge"} progress = 0 finished = false function idle_cb() gauge.value = progress return finished and iup.CLOSE or iup.DEFAULT end iup.SetIdle(idle_cb) function background_work() for i = 1, 10 do progress = progress + 0.1 sleep(1000) end finished = true end dlg:showxy(iup.CENTER, iup.CENTER) newthread "background_work()" iup.MainLoop() dlg:hide()