roku - Click button not fire a click Event and how to navigate another panel in ROKU
问题描述
I create the Login panel in Roku. At a Login time, I click ok button to navigate another panel it is possible.
I create a login panel with using two text boxes one for username and another for password and two buttons one for sign-in and another for cancel. An issue is I click the sign-in button but not click event fire
I use button group and the following code in onkeyevent
if m.btngrp.buttonSelected = 0 then
if key = "OK"
? "print the sign-in button"
end if
else if m.btngrp.buttonSelected = 1 then
if key = "OK"
? "print the setting button"
end if
else
? "nothing press"
end if
please anyone find these problem help me.
解决方案
我假设您已经在 Button Group 组件中设置了一个观察者:
m.btngrp.observeField("buttonSelected", "onButtonSelected")
然后,在回调中你应该有:
function onButtonSelected()
if m.btngrp.buttonSelected = 0 then
? "print the sign-in button"
else if m.btngrp.buttonSelected = 1 then
? "print the setting button"
end if
end function
推荐阅读
- excel - 将数据从 Excel 2016 复制到 Word 2016 表
- typescript - 无法用 Jest 读取未定义的属性
- reactjs - Formik setValues() 抛出“重新渲染过多”错误
- r - 在 R 中有效地取消嵌套大型数据表
- python - 在 Python 中切换 Ursina 实体可见性
- bash - 如何将作为目录的变量 ${outputdirectory%%/*} 转换为 powershell 脚本?
- python - 从字节转换后图像变为蓝色
- python - 如何根据特定列删除 DataFrame 中的索引?
- python-3.x - Python tkinter / pypdftk / subprocess 的问题(?)
- flutter - Flutter Windows桌面中的AltGr键问题