EDIT: NEVER MIND! I figured out my problem. I needed to create a reference directly to the node. I wrote n=m.top.findNode("buttonPairLeft") and that let me add in the values. So that's good
😄EDIT: update, I was told my issue is that I hadn't added any buttons, but given the formatting that i've opted to use I don't know how to add the buttons. I'm not sure it can be done directly while writing the nodes (using a buttons field), as the file is telling me there are errors. I attempted to set the values with the associative array format (i.e. layoutgroup.MainScreenLayoutGroup.innerGroup.buttonPairLeft.buttons = ["test1", "test2"]) but that didn't work either. So... what am I supposed to do here?
<ButtonGroup id="buttonPairLeft"
minWidth ="100"
buttonHeight="10"
buttons="[test1, test2]"
/>
<ButtonGroup id="buttonPairRight"
minWidth="100"
buttonHeight="10"
buttons="[test3, test4]"
/>
(I wonder if anybody is recognizing me at this point)I am currently writing code for a screen graph application in which I have 5 buttons arranged into a configuration where four buttons are in a grid-like layout below one wide button. I've managed to get a start on the configuration but, when I launch the app, it only shows me the one wide button. I'm not sure what I've missed here. Can anybody help, please?
this is the code I have:
[spoiler=code:gfvfhrgw]
<?xml version="1.0" encoding="utf-8"?>
<component name="MainScreen" extends="Scene">
<script type="text/brightscript" uri="pkg:/components/MainScreen.brs" />
<children>
<Group id ="MainScreenGroup">
<LayoutGroup id="MainScreenLayoutGroup"
layoutDirection ="vert"
vertAlignment="center"
itemSpacings="[10]"
addItemSpacingAfterChild="true" >
<Button id="streamButton"
text="Watch live service"
minWidth="1000"
height ="200"
showFocusFootprint="true"
/>
<LayoutGroup id="innerGroup"
layoutDirection ="horiz"
itemSpacings="10"
addItemSpacingAfterChild="true" >
<ButtonGroup id="buttonPairLeft"
minWidth ="100"
buttonHeight="10"
/>
<ButtonGroup id="buttonPairRight"
minWidth ="100"
buttonHeight="10"
/>
</LayoutGroup>
</LayoutGroup>
</Group>
</children>
</component>
MainScreen.brs:
sub init()
'we can add a background here
'm.top.backgroundURI= some image url
m.top.setFocus(true)
layoutgroup = m.top.findNode("MainScreenGroup")
devInfo = createObject("roDeviceInfo")
UIResolution = devInfo.getUIResolution()
lgr = layoutgroup.boundingRect()
lglr = layoutgroup.localBoundingRect()
x = -lgr.x + (UIResolution.width - lglr.width) / 2
y = -lgr.y + (UIResolution.height - lglr.height) / 2
layoutgroup.translation = [x, y]
end sub
[/spoiler:gfvfhrgw]
I AM THE ARCHMAGE... who is also rather new to Brightscript so forgive me for seeming inept at times.