Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted

Re: Beta Scene Graph Components

I still have a problem with the rowItemSize attribute of the row list component even after the upgrade. Current version is 7.2.0 build 4091-04. The row list attributes like this one (rowItemSize) can only be set in the script that is used for my component ? I'm not able to override them in the main thread. I am creating the component and after that I want to set the attributes and it's not working

m.homeScreenRowList = m.app.mainScene.createChild(componentsName.SG_ROW_LIST_GRID)
m.homeScreenRowList.id = componentsName.SG_HOMESCREEN
m.homeScreenRowList.rowHeights = getRowDimensions(m.response, false , sgConfig.ROW_MENU_ITEM_SIZE[1])
m.homeScreenRowList.rowItemSize = rowItemSize

RowItemSize is a variable that holds the values for the rowItemSize
Here is the output :

printing row item size from variable
item size is <Component: roArray> =
[
264
110
]
item size is <Component: roArray> =
[
264
149
]
item size is <Component: roArray> =
[
165
247
]
item size is <Component: roArray> =
[
264
149
]
item size is <Component: roArray> =
[
264
149
]
item size is <Component: roArray> =
[
264
149
]
item size is <Component: roArray> =
[
165
247
]
item size is <Component: roArray> =
[
165
247
]
item size is <Component: roArray> =
[
165
247
]
item size is <Component: roArray> =
[
264
149
]


But if I try to print what's in m.homeScreenRowList.rowItemSize I will get only the values that were set when init function of the component ran.This method of changing the rowItemSize attribute worked fine before 7.2.

output:

printing rowList rowItemSize attribute
<Component: roArray> =
[
264
149
]
0 Kudos
Highlighted
Level 9

Re: Beta Scene Graph Components

"dacian_roman23" wrote:
I still have a problem with the rowItemSize attribute of the row list component even after the upgrade. Current version is 7.2.0 build 4091-04. The row list attributes like this one (rowItemSize) can only be set in the script that is used for my component ? I'm not able to override them in the main thread. I am creating the component and after that I want to set the attributes and it's not working

I am having really hard time trying to understand your example. Case might be something i am interested in but IDK.
Can you give very specific example "when i do this - it works" vs "when i do that - it doesn't" - and also put them in [ code] [/code] brackets?
0 Kudos
Highlighted

Re: Beta Scene Graph Components

"EnTerr" wrote:
"dacian_roman23" wrote:
I still have a problem with the rowItemSize attribute of the row list component even after the upgrade. Current version is 7.2.0 build 4091-04. The row list attributes like this one (rowItemSize) can only be set in the script that is used for my component ? I'm not able to override them in the main thread. I am creating the component and after that I want to set the attributes and it's not working

I am having really hard time trying to understand your example. Case might be something i am interested in but IDK.
Can you give very specific example "when i do this - it works" vs "when i do that - it doesn't" - and also put them in [ code] [/code] brackets?



I have one component called rowListGrid that extends the rowList component and has the rowListGrid.brs script for it.If I try to set the rowItemSize attribute in the init function of the script ..everything works as expected (m.rowGridConfig is just an associative array holding some constants).. for example

function init()
componentsName = getComponentsNameConstants()
m.rowGridConfig = getRowGridConfig()
m.top.visible = false

m.top.itemComponentName = componentsName.SG_ROW_LIST_ITEM
m.top.translation = m.rowGridConfig.TRANSLATION

m.top.itemSize = m.rowGridConfig.ITEM_SIZE
m.top.itemSpacing = m.rowGridConfig.ITEM_SPACING

m.top.showRowLabel = true
m.top.rowLabelFont = getFontForRowHeader()
m.top.rowLabelColor = m.rowGridConfig.WHITE_COLOR
m.top.rowLabelOffset = m.rowGridConfig.ROW_LABEL_OFFSET

m.top.rowHeights = m.rowGridConfig.ROW_HEIGHTS
m.top.rowItemSize = m.rowGridConfig.ROW_ITEM_SIZE
m.top.rowSpacings = m.rowGridConfig.ROW_SPACINGS
m.top.rowItemSpacing = m.rowGridConfig.ROW_ITEM_SPACING
m.top.rowFocusAnimationStyle = "fixedFocusWrap"
m.top.focusXOffset = [0.0]'
end function



But if i'm trying to do this for example in main.brs script or in any other script file that runs under the main brightscript thread, it will not overwrite the value for the rowItemSize that was set in the init function of the rowListGrid.brs...although I have used this approach and worked fine before 7.2

 
m.homeScreenRowList = m.app.mainScene.createChild(componentsName.SG_ROW_LIST_GRID) ' this is my component that extends the row list component, and please note that this triggers the init function mentioned above

m.homeScreenRowList.id = componentsName.SG_HOMESCREEN
m.homeScreenRowList.rowItemSize = getRowDimensions(m.response, true , sgConfig.ROW_MENU_ITEM_SIZE) 'this function returns an array with arrays with the dimensions needed
m.homeScreenRowList.showRowLabel = [false, true]
m.homeScreenRowList.rowSpacings = [sgConfig.ROW_MENU_MARGIN_BOTTOM] 'just a constant value
m.homeScreenRowList.rowHeights = getRowDimensions(m.response, false , sgConfig.ROW_MENU_ITEM_SIZE[1]) 'returning an array with heights for the rowHeights attribute
0 Kudos
Highlighted

Re: Beta Scene Graph Components

Here is another output for this code

sgConfig = getRowGridConfig()

rowItemSize = getRowDimensions(m.response, true , sgConfig.ROW_MENU_ITEM_SIZE)
componentsName = getComponentsNameConstants()
m.homeScreenRowList = m.app.mainScene.createChild(componentsName.SG_ROW_LIST_GRID)

print "printing rowItemSize variable"
print rowItemSize

print "-----------------------------"

print "printing rowItemSize values"

for each itemSize in rowItemSize
print itemSize
end for

stop
m.homeScreenRowList.rowItemSize = []
m.homeScreenRowList.rowItemSize = rowItemSize
stop


And here is some output from the debugger
==================================

printing rowItemSize variable
<Component: roArray> =
[
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
]
-----------------------------
printing rowItemSize values
<Component: roArray> =
[
264
110
]
<Component: roArray> =
[
264
149
]
<Component: roArray> =
[
165
247
]
<Component: roArray> =
[
264
149
]
<Component: roArray> =
[
264
149
]
<Component: roArray> =
[
264
149
]
<Component: roArray> =
[
165
247
]
<Component: roArray> =
[
165
247
]
<Component: roArray> =
[
165
247
]
<Component: roArray> =
[
264
149
]

BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.


Current Function:
070: print "-----------------------------"
071:
072: print "printing rowItemSize values"
073:
074: for each itemSize in rowItemSize
075: print itemSize
076: end for
077:
078:* stop
079: m.homeScreenRowList.rowItemSize = []
080: m.homeScreenRowList.rowItemSize = rowItemSize
081: stop
082:
STOP (runtime error &hf7) in pkg:/source/appHome.brs(78)
078: stop
Backtrace:
#5 Function homescreen_handlefetchsuccess() As Dynamic
file/line: pkg:/source/appHome.brs(79)
#4 Function homescreen_populatescreen() As Dynamic
file/line: pkg:/source/appHome.brs(47)
#3 Function homescreen_show() As Dynamic
file/line: pkg:/source/appHome.brs(36)
#2 Function app_showhomescreen() As Dynamic
file/line: pkg:/source/app.brs(95)
#1 Function app_show(startingpage As Object) As Void
file/line: pkg:/source/app.brs(87)
#0 Function runuserinterface(ecp As Dynamic) As Dynamic
file/line: pkg:/source/main.brs(22)
Local Variables:
global rotINTERFACE:ifGlobal
m roAssociativeArray refcnt=7 count:16
sgconfig roAssociativeArray refcnt=1 count:37
rowitemsize roArray refcnt=1 count:10
componentsname roAssociativeArray refcnt=1 count:17
itemsize roArray refcnt=6 count:2

BrightScript Debugger> ? m.homeScreenRowList.rowItemSize
<Component: roArray> =
[
<Component: roArray>
]

BrightScript Debugger> ? m.homeScreenRowList.rowItemSize[0] --- this is the default value that was set in the init function
<Component: roArray> =
[
264
149
]

BrightScript Debugger> s
079: m.homeScreenRowList.rowItemSize = []

BrightScript Debugger> ? m.homescreenrowlist.rowItemSize -- so far, so good .. i have changed the rowItemSize attribute to an empty array
<Component: roArray> =
[
]

BrightScript Debugger> ? rowItemSize -- checking my rowItemSize variable again
<Component: roArray> =
[
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
]

BrightScript Debugger> s
080: m.homeScreenRowList.rowItemSize = rowItemSize -- setting the rowItemSize attribute again

BrightScript Debugger> ? m.homeScreenRowList.rowItemSize
<Component: roArray> =
[
] ---- i should see the values printed above, right ? Smiley Sad Smiley Sad

Here is the different output - using 7.1 firmware - but the same code
===================================================
printing rowItemSize variable
<Component: roArray> =
[
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
]
-----------------------------
printing rowItemSize values
<Component: roArray> =
[
264
110
]
<Component: roArray> =
[
264
149
]
<Component: roArray> =
[
264
149
]
<Component: roArray> =
[
165
247
]
<Component: roArray> =
[
264
149
]
<Component: roArray> =
[
264
149
]
<Component: roArray> =
[
264
149
]
<Component: roArray> =
[
165
247
]
<Component: roArray> =
[
165
247
]
<Component: roArray> =
[
165
247
]
<Component: roArray> =
[
264
149
]

BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.


Current Function:
072:
073: print "printing rowItemSize values"
074:
075: for each itemSize in rowItemSize
076: print itemSize
077: end for
078:
079:
080:* stop
081: m.homeScreenRowList.rowItemSize = []
082: m.homeScreenRowList.rowItemSize = rowItemSize
083: stop
084:
STOP (runtime error &hf7) in pkg:/source/appHome.brs(80)
080: stop
Backtrace:
#5 Function homescreen_handlefetchsuccess() As Dynamic
file/line: pkg:/source/appHome.brs(81)
#4 Function homescreen_populatescreen() As Dynamic
file/line: pkg:/source/appHome.brs(47)
#3 Function homescreen_show() As Dynamic
file/line: pkg:/source/appHome.brs(36)
#2 Function app_showhomescreen() As Dynamic
file/line: pkg:/source/app.brs(95)
#1 Function app_show(startingpage As Object) As Void
file/line: pkg:/source/app.brs(87)
#0 Function runuserinterface(ecp As Dynamic) As Dynamic
file/line: pkg:/source/main.brs(22)
Local Variables:
global rotINTERFACE:ifGlobal
m roAssociativeArray refcnt=7 count:16
sgconfig roAssociativeArray refcnt=1 count:37
rowitemsize roArray refcnt=1 count:11
componentsname roAssociativeArray refcnt=1 count:17
itemsize roArray refcnt=7 count:2

BrightScript Debugger> s
081: m.homeScreenRowList.rowItemSize = []

BrightScript Debugger> ? m.homeScreenRowList.rowItemSize
<Component: roArray> =
[
]

BrightScript Debugger> s
082: m.homeScreenRowList.rowItemSize = rowItemSize

BrightScript Debugger> ? m.homeScreenRowList.rowItemSize
<Component: roArray> =
[
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
]

BrightScript Debugger>

0 Kudos
Highlighted

Re: Beta Scene Graph Components

In 7.2 .0 - build 4091-04 it looks like I am not able to set a rowItemSize to an array that has more than 3 other arrays in it . I have limited the function mentioned in previous post that creates the rowItemSize values to return only 3 items and everything worked, but if the returned items number is bigger than 3, then setting the rowitemSize attribute fails .I'll have a deeper look

Here's the debugger output

printing rowItemSize variable
<Component: roArray> =
[
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
]
-----------------------------
printing rowItemSize values
<Component: roArray> =
[
264
110
]
<Component: roArray> =
[
264
149
]
<Component: roArray> =
[
165
247
]
<Component: roArray> =
[
264
149
]

Current Function:
072:
073: print "printing rowItemSize values"
074:
075: for each itemSize in rowItemSize
076: print itemSize
077: end for
078:
079:
080:* stop
081: m.homeScreenRowList.rowItemSize = rowItemSize
082: stop
083:
084: m.homeScreenRowList.id = componentsName.SG_HOMESCREEN
STOP (runtime error &hf7) in pkg:/source/appHome.brs(80)
080: stop
Backtrace:
#5 Function homescreen_handlefetchsuccess() As Dynamic
file/line: pkg:/source/appHome.brs(81)
#4 Function homescreen_populatescreen() As Dynamic
file/line: pkg:/source/appHome.brs(47)
#3 Function homescreen_show() As Dynamic
file/line: pkg:/source/appHome.brs(36)
#2 Function app_showhomescreen() As Dynamic
file/line: pkg:/source/app.brs(95)
#1 Function app_show(startingpage As Object) As Void
file/line: pkg:/source/app.brs(87)
#0 Function runuserinterface(ecp As Dynamic) As Dynamic
file/line: pkg:/source/main.brs(22)
Local Variables:
global rotINTERFACE:ifGlobal
m roAssociativeArray refcnt=7 count:16
sgconfig roAssociativeArray refcnt=1 count:37
rowitemsize roArray refcnt=1 count:4
componentsname roAssociativeArray refcnt=1 count:17
itemsize roArray refcnt=3 count:2

BrightScript Debugger> ? rowItemSize
<Component: roArray> =
[
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
]

BrightScript Debugger> s
081: m.homeScreenRowList.rowItemSize = rowItemSize

BrightScript Debugger> ? m.homeScreenRowList.rowItemSize
<Component: roArray> =
[
]

BrightScript Debugger> rowItemSize.pop()

BrightScript Debugger> ? rowItemSIze
<Component: roArray> =
[
<Component: roArray>
<Component: roArray>
<Component: roArray>
]

BrightScript Debugger> m.homeScreenRowList.rowItemSize = rowItemSize

BrightScript Debugger> ? m.homeScreenRowList.rowItemSize
<Component: roArray> =
[
<Component: roArray>
<Component: roArray>
<Component: roArray>
]

BrightScript Debugger>
0 Kudos
Highlighted

Re: Beta Scene Graph Components

Can anyone help me with a simple rowList example in 7.2 firmware version where rowItemSize attribute is changed dynamically in the main thread ?
0 Kudos
Highlighted
Level 9

Re: Beta Scene Graph Components

"dacian_roman23" wrote:
Can anyone help me with a simple rowList example in 7.2 firmware version where rowItemSize attribute is changed dynamically in the main thread ?

Somebody from the small hired army of "evangelists" should be able to help you (where are they when you need one?!).

In the mean time, do these two help?
viewtopic.php?f=34&t=95504
viewtopic.php?f=34&t=95416
0 Kudos
Highlighted
Level 7

Re: Beta Scene Graph Components

This will likely get lost in the noise here, but I wanted to give everyone a heads up that in previous builds of my channel "m.top.observeField("visible", "onVisibleChange")" was only firing on, well, a visible change. As of 7.2, this appears to fire during init as well.

Caused a bug in my app, since I wasn't checking the visible state. My bad in the end, but these types of changes in behavior from firmware to firmware can cause issues in apps.
0 Kudos
Highlighted

Re: Beta Scene Graph Components

"EnTerr" wrote:
"dacian_roman23" wrote:
Can anyone help me with a simple rowList example in 7.2 firmware version where rowItemSize attribute is changed dynamically in the main thread ?

Somebody from the small hired army of "evangelists" should be able to help you (where are they when you need one?!).

In the mean time, do these two help?
viewtopic.php?f=34&t=95504
viewtopic.php?f=34&t=95416


Thanks EnTerr for the links. I'll have a look to see if somehow they can solve my problem. My biggest concern now with this 7.2 release is that I can't be sure if the bugs are from my code, from the firmware or both and it's even harder to test such problems Smiley Sad
0 Kudos
Highlighted

Re: Beta Scene Graph Components

Here's another strange issue . Trying to set the rowItemSize attribute for the rowListComponent.Below is the printed array that i'm trying to set on the rowItemSize . According to their documentation -
rowItemSize is an array of vector2d (i suppose that a vector2d array is an array containing other arrays .. each array having 2 values, one for item with and one for item height) but as you can see i get a type mismatch error. What is wrong here ? Is this a bug in the firmare ? The documentation has not been updated ?

<Component: roArray> =
[
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
<Component: roArray>
]
roArray
<Component: roArray> =
[
264
110
]
<Component: roArray> =
[
264
149
]
<Component: roArray> =
[
165
247
]
<Component: roArray> =
[
264
149
]
<Component: roArray> =
[
264
149
]
<Component: roArray> =
[
264
149
]
<Component: roArray> =
[
165
247
]
<Component: roArray> =
[
165
247
]
<Component: roArray> =
[
165
247
]
<Component: roArray> =
[
264
149
]
----------------------------------
=================================================================
Warning occurred while setting a field of an RoSGNode
-- Type mismatch occurred when setting the "rowitemsize" field of a "RowList" node
at line 75 of file pkg:/components/RowList/RowList.brs
=================================================================

0 Kudos