Hi experts,
start to getting crazy with widgets , many different codes do not work when I run them, the below is one of them… it is straight forward… I got id as nil… any one knows why ?
[lua]
local widget = require “widget”
local function onBtnPress( event )
print( "You pressed tab button: " , event.target.id )
end
local tabButtons = {
{
id = “list”,
label = “New Leads”,
defaultFile = “13-target.png”,
overFile = “13-target-down.png”,
width = 28, height = 28,
onPress = onBtnPress,
selected = true
},
{
id = “saved”,
label = “Saved”,
defaultFile = “37-suitcase.png”,
overFile = “37-suitcase-down.png”,
width = 26, height = 26,
onPress = onBtnPress
},
{
id = “settings”,
label = “Settings”,
defaultFile = “19-gear.png”,
overFile = “19-gear-down.png”,
width = 26, height = 26,
onPress = onBtnPress
},
}
local tabs = widget.newTabBar {
top = display.contentHeight-50,
buttons = tabButtons
}
[/lua]
Regards
Abdul