Page 1 of 1

Button bounce issue

Posted: 24 Jan 2014 23:01
by destroyedlolo
Hello,

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 click on the button, I got changePreview() called twice which obviously it's not what is expected :D
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 ?

Re: Button bounce issue

Posted: 25 Jan 2014 11:32
by mederi

Code: Select all

widgets.preview:set_text('N/A')
Try to avoid setting text for the button widget.

Re: Button bounce issue

Posted: 26 Jan 2014 11:39
by destroyedlolo
For sure ... but it's on purpose : the button's text changes as per camera status.

Re: Button bounce issue

Posted: 27 Jan 2014 19:50
by mederi
If you cannot fix VLC code, then use some workaroud. For example, display a status in a label widget next to the button.

Re: Button bounce issue

Posted: 31 Jan 2014 21:48
by destroyedlolo
well well well : I give up :roll:
w/o notifications on dropdown, the interface looks like terribly ugly.
w/o timer, the application is only a CPU hog
and now, with this bug, my code will become rapidly totally unmaintainable and will not be reliable ...

So, I'll create a pure Lua apps and try to control VLC thru it's DBus interface ...

Re: Button bounce issue

Posted: 19 Jan 2015 18:11
by mederi