HELP! How do I get #label to update to values from plugin code? (1 Viewer)

bushbrother

Portal Pro
February 14, 2008
192
15
UK
Home Country
United Kingdom United Kingdom
Hi All,

I am trying to write a plugin and I am getting stuck at the skinning stage, I am just trying to write the output of a bit of code run when I press a button and make that display in the skin.

I have initialised the label control:
Code:
[SkinControlAttribute(101)] protected GUILabelControl label_numDownloads = null;

And then in the code that is being run when the button is pressed I have:
Code:
GUIPropertyManager.SetProperty("#numDownloads", string.Format("{0}",numOfTorrents));

And finally in my XML I have:
Code:
    <control>
      <description>text label</description>
      <type>label</type>
      <id>101</id>
      <posX>60</posX>
      <posY>150</posY>
      <label>#numDownloads</label>
      <font>mediastream9c</font>
      <textcolor>ff025984</textcolor>
      <visible>true</visible>
    </control>

But when I open th plugin in mediaportal I see the button but the text under it is just "#NUMDOWNLOADS" and it never changes even if I press the button. What am I doing wrong?
 

seco

Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    Have you tried without defining [SkinControlAttribute(101)] protected GUILabelControl label_numDownloads = null; and using <id>0</id> ?
     

    bushbrother

    Portal Pro
    February 14, 2008
    192
    15
    UK
    Home Country
    United Kingdom United Kingdom
    Cool, that did work, I also found a bug in my code meaning the value was never initialised too. Thanks for the help so quickly!
     

    Users who are viewing this thread

    Top Bottom