Hi!

I try to catch for iup.timer action_cb() overlap.
But fail (example in attach).
It's can overlap for same timer?
require "iuplua"

local LIMIT = 1
local MAX_LIMIT = 10000000

lbl_lim = iup.label{
    rastersize = "200x30",
    alignment = "acenter:acenter",
    title = LIMIT,
}

val = iup.val{
    min = 1,
    max = MAX_LIMIT,
    rastersize = "200x30",
}
function val:valuechanged_cb()
    local n = math.floor(self.value)
    lbl_lim.title = n
    LIMIT = n
    return iup.DEFAULT
end

dlg = iup.dialog{
    iup.frame {
        title = "Max Iterations",
        iup.vbox{
            lbl_lim,
            val,
        }
    }
}

local F = 0

timer = iup.timer{time=10,}
function timer:action_cb()
    if F > 0 then
        print("OBERLAP")
    end

    F = F + 1
    for i=1,LIMIT do
        local x = math.sqrt(3)
    end
    F = F - 1
end

dlg:showxy(iup.CENTER, iup.CENTER)

timer.run = "YES"

iup.MainLoop()
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to