Of course you can. So. I wasn’t sure if I should make a a separate file for if or add it to my level1 or menu lua. But I tried both and still got the same error.
[code] widget.newPickerWheel( “pickerWheel” )
widget.setTheme(“widget”)
– localize a couple variables prior to use
local myPicker, doneButton
– button event handler
local onDone = function( event )
– get values from picker wheel
local m = myPicker.col1.value
local d = myPicker.col2.value
local y = myPicker.col3.value
– Print the results to the terminal:
print( m … " " … d … ", " … y )
– remove the button
display.remove( doneButton )
doneButton = nil
– remove the picker wheel
display.remove( myPicker )
myPicker = nil
end
– Create the picker widget:
myPicker = widget.newPickerWheel{ preset=“usDate”, startDay=19, startMonth=2, startYear=2011 }
widget.setTheme(“pickerWheel”)
local widget=require(“myPicker”)
– Place picker wheel at bottom of iPhone screen:
myPicker.y = display.contentHeight - myPicker.height
– Create a “Done” ui button widget to capture picker selection:
doneButton = widget.newButton{ label=“Done”, onRelease=onDone }
doneButton:setReferencePoint( display.CenterRightReferencePoint )
doneButton.x = display.contentWidth - 5
doneButton.y = 22
[/code]
[import]uid: 69302 topic_id: 30437 reply_id: 122204[/import]