2010-02-10, 10:33 AM
I'm probably missing something fundamental but I'm having problems using UIStatic to display some information in a plugin I'm developing...
This is the relevant portion of my code:
I have a CompositeImage tag in my skin.xml file for StatusInfo:
The error I'm getting is with the line:
and the Logs show:
What am I doing wrong?? I'm prepared to be embarrassed by a simple mistake!
This is the relevant portion of my code:
Code:
private UiStatic statusInfoText;
protected override void initialise()
{
string skinFileName = getSkinSubdirectory() + "\\skin.xml"; skinHelper2 = new SkinHelper2(skinFileName);
Hashtable args = new Hashtable();
args["@info"] = "Hello World";
statusInfoText = new UiStatic(skinHelper2, "StatusInfo", args);
logMessage("initialise()", "called");
base.initialise();
}
public override ArrayList GetRenderList()
{
logMessage("GetRenderList()", "started");
renderList.AddRange(statusInfoText.GetRenderList());
logMessage("GetRenderList()", "called");
return base.GetRenderList();
}
I have a CompositeImage tag in my skin.xml file for StatusInfo:
Code:
<CompositeImage name="StatusInfo" size="60,4.5">
<DrawText text="@info" loc="0,0" size="95,95" textStyle="GeneralTextStyle"
align="Left"/>
</CompositeImage>
The error I'm getting is with the line:
Code:
renderList.AddRange(statusInfoText.GetRenderList());
and the Logs show:
Code:
2010-02-10 10:11:32.390 VERBOSE [1] UITesting: GetRenderList() - started
2010-02-10 10:11:32.515 ERROR [1] Unexpected error: System.NullReferenceException: Object reference not set to an instance of an object.
at MyPlugin.UITesting.GetRenderList()
at GBPVRX2.MenuTask.x9006c1ed9ccb79de.GetRenderList()
at GBPVRX2.x0061b801bdf12d35.xdb012c437aec4a40(Boolean xd23bf32f3b17e3be)
at GBPVRX2.xb979ad394703258e.xfb409e85bd292293(String[] xf18a926310372520)
What am I doing wrong?? I'm prepared to be embarrassed by a simple mistake!