NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 20 21 22 23 24 … 93 Next »
Problem using UIStatic

 
  • 0 Vote(s) - 0 Average
Problem using UIStatic
philcooling
Offline

Junior Member

Posts: 15
Threads: 5
Joined: Nov 2009
#1
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:
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! Big Grin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,643
Threads: 767
Joined: Nov 2003
#2
2010-02-10, 03:42 PM
Does you log message in the initialise() function end up in the log? (ie, so we know that statusInfoText isnt null)
philcooling
Offline

Junior Member

Posts: 15
Threads: 5
Joined: Nov 2009
#3
2010-02-10, 03:56 PM
Yeah - it does log the "initialise() called" entry
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,643
Threads: 767
Joined: Nov 2003
#4
2010-02-10, 03:58 PM
Ah - I'm guessing you're not allocating renderList?
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#5
2010-02-10, 03:59 PM
Do you have Placement tag in the skin file?

eg <Placement name="StatusInfo" loc="3.5,60" />
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,809
Threads: 954
Joined: May 2006
#6
2010-02-10, 11:57 PM
For all my UiStatics I use .SetArgs to set it up ie.

staticInfoText.SetArgs(args);

Martin
philcooling
Offline

Junior Member

Posts: 15
Threads: 5
Joined: Nov 2009
#7
2010-02-11, 03:23 PM
sub Wrote:Ah - I'm guessing you're not allocating renderList?

Good spot - no I hadn't! Whoops!

McBainUK Wrote:Do you have Placement tag in the skin file?

eg <Placement name="StatusInfo" loc="3.5,60" />

Yes already I have.

OK - having allocated renderList the plugin no longer crashes at startup but my Text doesn't appear at all. The skin file looks good - I know it's case-sensitive so I've checked (and double-checked) the names etc. but can't spot what's wrong - I've been staring at my code for so long I'm starting to go cross-eyed! Maybe someone else can see what I'm not!
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#8
2010-02-11, 03:34 PM
Can you post the complete file. Snippets can be hard to deal with.
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
philcooling
Offline

Junior Member

Posts: 15
Threads: 5
Joined: Nov 2009
#9
2010-02-11, 05:19 PM
I've gone back to first principles and re-downloaded Sub's "Hello World" sample plugin, adding in my "StatusInfo" code and still get nothing. I've attached the code & skin.xml file in the zip file in the hope this will help!
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,643
Threads: 767
Joined: Nov 2003
#10
2010-02-11, 05:23 PM
I havnt tried your code here, but you should really be allocating the render list each time GetRenderList is called:

Code:
public override ArrayList GetRenderList()
        {
            renderList = new ArrayList();
            renderList.Add(statusInfoText.GetRenderList());
            logMessage("GetRenderList()", "called");
            return base.GetRenderList();
        }
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  UiStatic vs UiElement? imilne 8 3,326 2012-12-24, 02:31 PM
Last Post: imilne
  Problem with preview image for Pending Recordings Northpole 2 1,972 2012-08-14, 02:56 AM
Last Post: Northpole
  ActivatePopup: SSPlus problem ACTCMS 10 4,690 2012-07-18, 09:43 PM
Last Post: ACTCMS
  Weird Code problem - serialisation (I'll spell it the proper way!!"0 psycik 22 6,079 2011-11-25, 03:16 AM
Last Post: whurlston
  Resolving required plugin assemblies problem McBainUK 37 11,956 2011-10-26, 06:12 PM
Last Post: psycik
  Drawing UiStatic mvallevand 4 2,205 2009-09-02, 10:06 PM
Last Post: mvallevand
  IVideoPlugin Problem SummerTimeBlues 9 3,831 2009-07-31, 04:02 AM
Last Post: sgilani
  Vista problem loading MovieWizManager.exe? JavaWiz 5 2,643 2008-06-05, 06:23 AM
Last Post: whurlston
  Missing assembly problem... bgowland 16 4,546 2008-01-10, 06:43 PM
Last Post: bgowland
  UIStatic update idkpmiller 3 1,872 2008-01-10, 02:35 AM
Last Post: idkpmiller

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode