2009-09-02, 02:29 AM
I am having trouble with UiStatic's not being redrawn if I don't use a ForceRePaint
I assume this is because the Sleep blocks needsRendering(), but I tried with a Timer too and that seems no better because I guess the needsRendering() doesn't work when the code is in another thread. I've fought this for a couple of evenings. Is there are better solution?
Martin
Code:
long slen = 0;
for (int i = 0; i < 8 && slen < 250000; i++)
{
try
{
FileInfo flen = new FileInfo(myVlcRecorder.outputFile);
slen = flen.Length;
flen = null;
Hashtable args = new Hashtable();
args["@nowPlaying"] = "Buffered " + slen.ToString();
nowPlayingUiStatic.SetArgs(args);
PluginHelperFactory.getPluginHelper().ForceRepaint();
}
catch
{
slen = 0;
}
Thread.Sleep(1000);
}
I assume this is because the Sleep blocks needsRendering(), but I tried with a Timer too and that seems no better because I guess the needsRendering() doesn't work when the code is in another thread. I've fought this for a couple of evenings. Is there are better solution?
Martin