Hi , I’m having problem disabling widget button
I tried typing [lua] PlayButton.isActive = false[/lua]
but it doesn’t work.
Could someone please help me?
Thanks.
[import]uid: 119325 topic_id: 22392 reply_id: 322392[/import]
Hi , I’m having problem disabling widget button
I tried typing [lua] PlayButton.isActive = false[/lua]
but it doesn’t work.
Could someone please help me?
Thanks.
[import]uid: 119325 topic_id: 22392 reply_id: 322392[/import]
@ ertzel
Thank you so much for helping. [import]uid: 119325 topic_id: 22392 reply_id: 89278[/import]
As far as I know, there is no built in isActive function for widget.newButton, although you could add it in on your own like this:
[code]
local onButtonEvent = function (event )
– Where we normally just check for the release phase, we will now check for active state
if event.phase == “release” and myButton.isActive == true then
print( “You pressed and released a button!” )
end
end
local myButton = widget.newButton{
id = “btn001”,
left = 100,
top = 200,
label = “Widget Button”,
width = 150, height = 28,
cornerRadius = 8,
onEvent = onButtonEvent
}
myButton.isActive = true
– where ever you want to make it inactive you would do
myButton.isActive = false
[/code] [import]uid: 69700 topic_id: 22392 reply_id: 89276[/import]