Button bounce issue
Posted: 24 Jan 2014 23:01
Hello,
With the following code :
If I click on the button, I got changePreview() called twice which obviously it's not what is expected
If I remove vlc.stream() call or widgets.preview:set_text('N/A'), the problem is gone.
I'm using VLC 2.0.7 which is the latest stable version on Gentoo. Can you please tell me if you have the same behaviors with other version ?
Any tips to avoid this nasty bounce ?
With the following code :
Code: Select all
function descriptor()
return {
title = "Test";
version = "0.1";
author = "Destroyedlolo";
shortdesc = "Test";
capabilities = {}
}
end
widgets={}
function activate()
vlc.msg.info("Starting Test")
-- go go go !
createDlg()
ReadCamera()
updateDlg()
end
function updateDlg()
widgets.preview:set_text('N/A')
end
function ReadCamera()
local s, msg = vlc.stream('http://10.5.5.9/camera/se?t=')
end
function deactivate()
dlg:delete()
end
function createDlg()
dlg = vlc.dialog("Test")
dlg:add_label("Preview :", 1,3)
widgets.preview = dlg:add_button("N/A", changePreview, 2,3)
dlg:update()
dlg:show()
end
function changePreview()
vlc.msg.info("ChPrv")
end
If I remove vlc.stream() call or widgets.preview:set_text('N/A'), the problem is gone.
I'm using VLC 2.0.7 which is the latest stable version on Gentoo. Can you please tell me if you have the same behaviors with other version ?
Any tips to avoid this nasty bounce ?