Widget 2.0 newPickerWheel issues

I am getting the following error when trying to use the new 2.0 picker wheel:
ERROR: widget.newPickerWheel: theme data file expected, got nil

Below is my code:

  
 local dayNums = {}  
  
 for i=1,31 do  
 dayNums[i] = i  
 end  
  
 local columnData = {  
 {  
 alignment = "right",  
 width = 150,  
 startIndex = curDate.month,  
 labels = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" },  
 },  
 {  
 alignment = "center",  
 width = 55,  
 startIndex = curDate.day,  
 labels = dayNums,  
 },  
 {  
 alignment = "left",  
 width = 14,  
 startIndex = curDate.month,  
 labels = { "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012", "2013" },  
 },  
 }  
  
 -- create the actual picker widget with column data  
 local datepicker = widget.newPickerWheel{  
 top=dateLbl.y-32,  
 font=native.systemFont,  
 left=dateLbl.x-125,  
 totalWidth=200,  
 columns=columnData,  
 }  

I am not seeing any errors in my code, is this a bug? [import]uid: 58885 topic_id: 36377 reply_id: 336377[/import]

After you require widget with

local widget = require ("widget")  

try adding this for the built in ios theme

widget.setTheme( "widget\_theme\_ios")  

or this if you want the built in android theme

widget.setTheme( "widget\_theme\_android")  

There’s a way to define your own themes but I haven’t dug that far yet. [import]uid: 9422 topic_id: 36377 reply_id: 144479[/import]

Thanks HardBoiledIndustries!! Now if customizing this was documented… I think I read somewhere that it should be documented this week. I hope so because my picker wheels are all customized to look like the rest of my app UI. [import]uid: 58885 topic_id: 36377 reply_id: 144483[/import]

Customizing all widgets visually is documented already in our daily build docs: http://docs.coronalabs.com/daily/api/

It’s only creating your own theme file which isn’t currently documented. You will see a section named “Visual Customization” in all applicable widget documentation.

Theming guide will be made up asap.

Thanks! [import]uid: 84637 topic_id: 36377 reply_id: 144526[/import]

After you require widget with

local widget = require ("widget")  

try adding this for the built in ios theme

widget.setTheme( "widget\_theme\_ios")  

or this if you want the built in android theme

widget.setTheme( "widget\_theme\_android")  

There’s a way to define your own themes but I haven’t dug that far yet. [import]uid: 9422 topic_id: 36377 reply_id: 144479[/import]

Thanks HardBoiledIndustries!! Now if customizing this was documented… I think I read somewhere that it should be documented this week. I hope so because my picker wheels are all customized to look like the rest of my app UI. [import]uid: 58885 topic_id: 36377 reply_id: 144483[/import]

Customizing all widgets visually is documented already in our daily build docs: http://docs.coronalabs.com/daily/api/

It’s only creating your own theme file which isn’t currently documented. You will see a section named “Visual Customization” in all applicable widget documentation.

Theming guide will be made up asap.

Thanks! [import]uid: 84637 topic_id: 36377 reply_id: 144526[/import]

After you require widget with

local widget = require ("widget")  

try adding this for the built in ios theme

widget.setTheme( "widget\_theme\_ios")  

or this if you want the built in android theme

widget.setTheme( "widget\_theme\_android")  

There’s a way to define your own themes but I haven’t dug that far yet. [import]uid: 9422 topic_id: 36377 reply_id: 144479[/import]

Thanks HardBoiledIndustries!! Now if customizing this was documented… I think I read somewhere that it should be documented this week. I hope so because my picker wheels are all customized to look like the rest of my app UI. [import]uid: 58885 topic_id: 36377 reply_id: 144483[/import]

Customizing all widgets visually is documented already in our daily build docs: http://docs.coronalabs.com/daily/api/

It’s only creating your own theme file which isn’t currently documented. You will see a section named “Visual Customization” in all applicable widget documentation.

Theming guide will be made up asap.

Thanks! [import]uid: 84637 topic_id: 36377 reply_id: 144526[/import]

After you require widget with

local widget = require ("widget")  

try adding this for the built in ios theme

widget.setTheme( "widget\_theme\_ios")  

or this if you want the built in android theme

widget.setTheme( "widget\_theme\_android")  

There’s a way to define your own themes but I haven’t dug that far yet. [import]uid: 9422 topic_id: 36377 reply_id: 144479[/import]

Thanks HardBoiledIndustries!! Now if customizing this was documented… I think I read somewhere that it should be documented this week. I hope so because my picker wheels are all customized to look like the rest of my app UI. [import]uid: 58885 topic_id: 36377 reply_id: 144483[/import]

Customizing all widgets visually is documented already in our daily build docs: http://docs.coronalabs.com/daily/api/

It’s only creating your own theme file which isn’t currently documented. You will see a section named “Visual Customization” in all applicable widget documentation.

Theming guide will be made up asap.

Thanks! [import]uid: 84637 topic_id: 36377 reply_id: 144526[/import]

Danny ,

I came across this discussion when I had one issue using
[lua]
widget.setTheme( “theme_ios” )
[/lua]
which gave me an error " widget.newPickerWheel: theme data file expected, got nil "

Is there any documentation to explain how to use theme file ?

Thanks
Abdul

You shouldn’t need to set the theme unless you want a specific theme.  It will default to an iOS 7 like theme for iOS and an Android like theme for Android builds.  That theme is for iOS 6 look and feel which Apple will start complaining about on Feb 1.

Rob

I see Rob, 

in my case I got black buttons by default in the simulator… then I found the a tutorial to use this file but i was not lucky to make it work…

thanks

Abdul

You should use widget.setTheme( “widget_theme_ios” ) if you want the IOS 6 look. Details here : 

http://docs.coronalabs.com/api/library/widget/setTheme.html

ksan,

I did that but i want to use some custom colors for button using that external file but it didnt work even i saw it working in the tutorial … 

it worked like css for the html …

regards

Abdul

Using version 2014.2126 (2014.1.9). I’m having an issue where if you drag an item into the center and let go it doesn’t snap to the correct item. Any ideas on this?

Video:

http://cl.ly/2I3L3A2e3H2k

I would suggest updating to 2159 or later (the last version with widget fixes) and if it’s still not working correctly, submit a sample project (make sure to include your build.settings and config.lua) along with your video.  This landing issue should have been fixed a few widget updates back, but apparently something is still letting it get out of kilter.

Thanks

Rob