Bugs with widgets in new release, newPickerWheel and tableView:insert affected

This previously working code produced the error below it:

        local columnData =              {                  {                   align = "center",                   width =285,                   height = 100,                   startIndex = startIndex,                   labels = languageNames                 },             }         languageWheel = widget.newPickerWheel             {                left = display.contentWidth - 330,                top = sliderNumber\*sliderHeight+firstSliderY+textYOffset,                font = native.systemFontBold,                fontSize = 20,                overlayFrameWidth = 290,                columns = columnData             }

Runtime error

?:0: attempt to index field ‘colours’ (a nil value)

stack traceback:

        ?: in function <?:1116>

        (tail call): ?

        ?: in function ‘?’

        ?: in function <?:392>

        (tail call): ?

        ?: in function <?:122>

        (tail call): ?

        c:\users\dale\documents\github\orbitlab\screens\setupScreen.lua:571: in function ‘drawLanguagePicker’

        c:\users\dale\documents\github\orbitlab\screens\setupScreen.lua:654: in function <c:\users\dale\documents\github\orbitlab\screens\setupScreen.lua:42>

        ?: in function ‘dispatchEvent’

        ?: in function ‘gotoScene’

        c:\users\dale\documents\github\orbitlab\maingame.lua:1114: in function ‘setupBtnCallback’

        c:\users\dale\documents\github\orbitlab\controls\rightButtons.lua:148: in function ‘_onRelease’

        ?: in function ‘?’

        ?: in function <?:424>

        ?: in function <?:218>

This previously working code produced the error below it:

&nbsp; &nbsp; &nbsp; &nbsp; -- create the tableView widget &nbsp; &nbsp; &nbsp; &nbsp; local list = widget.newTableView{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; top = 20, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width = 250, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; height = 748, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; backgroundColor = { 32/gfactor,32/gfactor,32/gfactor,64/gfactor }, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; listener = tableViewListener, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onRowRender = onRowRender, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onRowUpdate = onRowUpdate, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onRowTouch = onRowTouch, &nbsp; &nbsp; &nbsp; &nbsp; }

Runtime error

?:0: attempt to perform arithmetic on field ‘separatorRightPadding’ (a nil value)

stack traceback:

        ?: in function ‘_createRow’

        ?: in function <?:1116>

        (tail call): ?

        c:\users\dale\documents\github\orbitlab\screens\infoScreen.lua:243: in function ‘makeInfoWidget’

        c:\users\dale\documents\github\orbitlab\screens\infoScreen.lua:285: in function <c:\users\dale\documents\github\orbitlab\screens\infoScreen.lua:59>

        ?: in function ‘dispatchEvent’

        ?: in function ‘gotoScene’

        c:\users\dale\documents\github\orbitlab\maingame.lua:1119: in function ‘infoBtnCallback’

        c:\users\dale\documents\github\orbitlab\controls\rightButtons.lua:176: in function ‘_onRelease’

        ?: in function ‘?’

        ?: in function <?:424>

        ?: in function <?:218>

Hi @mutatron,

The first error (pickerWheel) doesn’t seem related to Corona. What is the field “colours”? It’s not one that we implemented, as far as I’m aware.

On the second error, did you enter “separatorRightPadding” somewhere, or is that an internal thing that I may not have noticed was implemented by the engineers?

Best regards,

Brent

First issue :

line 339 in widget_tableview.lua (which is used by pickerwheel widget). Additional 10 occurrences of colors in widget_tableview.lua

if self.\_isUsedInPickerWheel then for i = 1, #self.\_rows do -- if the row is on screen, set it to the default color if nil ~= self.\_rows[i].\_view then self.\_rows[i].\_view[2]:setFillColor( unpack( self.\_themeParams.colours.pickerRowColor ) ) end end end

Second issue :

line 698 in widget_tableview.lua

local rightPadding = self.\_themeParams.separatorRightPadding

I have no clue what is causing the problem but just wanted to highlight the fact that it is something inside the widget code. 

@mutatron: are you using the core version of the widgets, or the github version? Also, it sounds to me like you are running a custom theme. Is that the case?

Thanks,

alex

Oh ya! That’s it. I recently modded the slider widget to take out the mRound on the returned value so I could get maximum resolution out of the slider instead of integers from 1 to 100.

So if I just do a refresh from github and then put my mods back in, that should do it?

@mutatron: Yes, a refresh from git suffices. Please however diff whatever changes you already did, to make sure none of your previous changes conflicts with the git codebase.

alex

can u post the actual link to download the source, so i can implement in my own project and do some changes??

Also any infos what I should know to implement :slight_smile:

thx

chris

Hi @mutatron,

The first error (pickerWheel) doesn’t seem related to Corona. What is the field “colours”? It’s not one that we implemented, as far as I’m aware.

On the second error, did you enter “separatorRightPadding” somewhere, or is that an internal thing that I may not have noticed was implemented by the engineers?

Best regards,

Brent

First issue :

line 339 in widget_tableview.lua (which is used by pickerwheel widget). Additional 10 occurrences of colors in widget_tableview.lua

if self.\_isUsedInPickerWheel then for i = 1, #self.\_rows do -- if the row is on screen, set it to the default color if nil ~= self.\_rows[i].\_view then self.\_rows[i].\_view[2]:setFillColor( unpack( self.\_themeParams.colours.pickerRowColor ) ) end end end

Second issue :

line 698 in widget_tableview.lua

local rightPadding = self.\_themeParams.separatorRightPadding

I have no clue what is causing the problem but just wanted to highlight the fact that it is something inside the widget code. 

@mutatron: are you using the core version of the widgets, or the github version? Also, it sounds to me like you are running a custom theme. Is that the case?

Thanks,

alex

Oh ya! That’s it. I recently modded the slider widget to take out the mRound on the returned value so I could get maximum resolution out of the slider instead of integers from 1 to 100.

So if I just do a refresh from github and then put my mods back in, that should do it?

@mutatron: Yes, a refresh from git suffices. Please however diff whatever changes you already did, to make sure none of your previous changes conflicts with the git codebase.

alex

can u post the actual link to download the source, so i can implement in my own project and do some changes??

Also any infos what I should know to implement :slight_smile:

thx

chris