Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
joetesta
Roku Guru

Re: roArray.Append: invalid parameter type roFloat

This works for updating the columnWidths field
  widths = m.itemlabel.getParent().getParent().columnWidths
  i = 0
  for each cw in widths
  if cw = 0
  widths[i] = m.filterUnderline.width
  exit for
  end if
  i++
  end for
  m.itemlabel.getParent().getParent().columnWidths = widths


However it's not working correctly in that when assigning the content to the node, the sequence of the items is different than the order the code above gets executed, so the widths are being assigned to the wrong columns....  hmm one step forward but now what...?
aspiring
0 Kudos
joetesta
Roku Guru

Re: roArray.Append: invalid parameter type roFloat

I got it!  This feels like coding gymnastics;
  widths = m.itemlabel.getParent().getParent().columnWidths
  content = m.itemlabel.getParent().getParent().content

  i = 0
  while i < content.getChildCount()
    c = content.getChild(i)
    if c.title = m.itemlabel.text
      ? i; ". "; m.itemlabel.text; " width: "; m.filterUnderline.width
      widths[i] = m.filterUnderline.width
      i = content.getChildCount()
    end if
    i++
  end while
  m.itemlabel.getParent().getParent().columnWidths = widths


Appreciate all your help, and any feedback on what I have here.  Thank you!!
aspiring
0 Kudos