I have built a long running script to which I have added a progress bar with the following code:
function StartProgressBar()
gaugeProgress = iup.gaugeProgress{}
gaugeProgress.show_text = "YES"
gaugeProgress.expand = "HORIZONTAL"
dlgProgress = iup.dialog{gaugeProgress; title = "Note Replacement in Progress"}
dlgProgress.size = "QUARTERxEIGHTH"
dlgProgress.menubox = "NO" -- Remove Windows close button and menu.
dlgProgress:showxy(iup.CENTER, iup.CENTER) -- Put up Progress Display
return dlgProgress
end
This is called before the loop and the progress bar updated during the loop (I am not calling MainLoop). At the end of the process I call dlgProgress.destroy to clear it.
As long as I don't take focus from the progress bar it works fine, but if focus is lost the program crashes, so I am sure I am doing this the wrong way. Can any one tell me the correct way. A detailed google did not find me any examples for iup, lua progress bars.
Thank you in advance.