lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,


Lua, Iup and SQlite are my choises for a simple administrative application.

A simple demo/test for highlighting clicked lines works perfectly for the left mouse button but not for any other.
According to the manual it should work:
""CLICK_CB: Action generated when any mouse button is pressed over a cell.""

-- my sample code:

matrix = iup.matrix{
    -- fill it
   currLine = 1,
}

-- highlight the clicked line and
-- colorize the last clicked line back to normal
function matrix:click_cb(li,c,r)
self["bgcolor"..self.currLine..":*"] = "255 255 255"  --white
self.currLine= li
print (" li, self.currLine, r ", li, self.currLine, r,"\n\n") -- to output window
self["bgcolor"..l..":*"] ="190 190 255"  -- blue
return IUP_DEFAULT
end

-- end code

Left mouse button works as expected.
When clicking the right mouse button nothing happens on the screen, but print output is correct, so the callback function has occured.. ""self.currLine"" holds the correct value but the buffer in the real handling code does not.. Cause when after some righthand clicks the left button is clicked again: the last highlighted line (by leftbutton clicking) is remembered and set back to normal, which is not the linenumber in self.currline, (and of course the clicked line is highlighted).
env: Lua 5.1, iup 2.7, win Vista sp1

Thanks for Help,

Rolf