Hello,
In the small sample attached I am trying to move a label containing an
image over a backgroundbox.
-On GTK it works well. I can press the mouse left button on the label
and drag it around.
-On Win32, I can only move it a little on the first mouse press. But
once released, when I try to move it a second time, it barely move by a
few pixels. It seems like it is loosing the focus.
Can anyone reproduce this behavior? Is it a bug? Am I just doing it wrong?
Regards
require("iuplua")
local img = iup.image{
width = 11,
height = 11,
pixels = {
1,2,0,0,0,0,0,0,0,2,1,
2,1,2,0,0,0,0,0,2,1,2,
0,2,1,2,0,0,0,2,1,2,0,
0,0,2,1,2,0,2,1,2,0,0,
0,0,0,2,1,2,1,2,0,0,0,
0,0,0,0,2,1,2,0,0,0,0,
0,0,0,2,1,2,1,2,0,0,0,
0,0,2,1,2,0,2,1,2,0,0,
0,2,1,2,0,0,0,2,1,2,0,
2,1,2,0,0,0,0,0,2,1,2,
1,2,0,0,0,0,0,0,0,2,1},
colors = {
"255 255 0", -- index 0
"0 1 0", -- index 1
"255 0 0", -- index 2
}
}
local l = iup.label {image = img,cx=0,cy=0}
function l:motion_cb(x, y, status)
if iup.isbutton1(status) then
l.CX = l.cx + x
l.CY = l.cy + y
iup.Refresh(l)
end
end
local c = iup.cbox {l}
local b = iup.backgroundbox{c,size="300x300"}
function b:action()
self:DrawBegin()
self:DrawRectangle(0, 0, 100,100)
self:DrawEnd()
end
local dialog = iup.dialog {b}
dialog:showxy(iup.CENTER, iup.CENTER)
if (iup.MainLoopLevel() == 0) then iup.MainLoop() end
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users