How to display waiting circle? (1 Viewer)

Vattenmelon

Portal Pro
June 1, 2007
159
22
Home Country
Norway Norway
Can anyone tell me how to show that waiting animation from a plugin? I have seen some code that uses "use Waitcursor" but can't really get it working.
 

kroko

Portal Pro
February 4, 2007
428
420
56
Itzehoe
Home Country
Germany Germany
Hi,

it should be enough to say

GUIWaitCursor.Init();
GUIWaitCursor.Show();
.
.
.do what ever
.
.
GUIWaitCursor.Hide();


Thats all, the class is static.

Regards
kroko
 

Vattenmelon

Portal Pro
June 1, 2007
159
22
Home Country
Norway Norway
Hmm.. I still can't see the waitcursor, do I need to put anything in the skin-file?

EDIT:
Well, it seems that I can display it. The problem is that it is only displayed after the timeconsuming part is done. For instance I would like to display the waitcursor, and then download some data from the internet.

If I have
GUIWaitcursor.show();
downloadData() // takes 15 secs
GUIWaitcursor.hide();

the cursor isn't displayed at all.

Guess I have to fiddle with threading or something to do that.
 

kroko

Portal Pro
February 4, 2007
428
420
56
Itzehoe
Home Country
Germany Germany
Hmm,


I tried it here and put the Show() in Onload of one plugin. The cursor is there and stays.

Are you doing that Onload ? Maybe this best way would be using a backgroundworker.

Regards
kroko
 

Vattenmelon

Portal Pro
June 1, 2007
159
22
Home Country
Norway Norway
Yes I tried to do it in the onload method. If I remove GUIWaitcursor.hide(); the cursor appears at the same time as the list is filled, and after the screen has been blank for some seconds. I'll have to try with a backgroundworker or something.
 

moiristo

Portal Pro
November 17, 2006
342
27
Enschede
Home Country
Netherlands Netherlands
Something like this:

Code:
_workerCompleted = false;

BackgroundWorker worker = new BackgroundWorker();

worker.DoWork += new DoWorkEventHandler(_DownloadWorker);
worker.RunWorkerAsync(arg);

while (_workerCompleted == false)  GUIWindowManager.Process();

one of the last pieces of old code from a plugin I've taken over :) Seems like calling GUIWindowManager.Process() is another way to display a wait cursor...
 

Vattenmelon

Portal Pro
June 1, 2007
159
22
Home Country
Norway Norway
Thx guys.. the solution for me was
Code:
        protected override void OnPageLoad()
        {
             GUIWaitCursor.Init();
             GUIWaitCursor.Show();
            _workerCompleted = false; //class member boolean

            BackgroundWorker worker = new BackgroundWorker();

            worker.DoWork += new DoWorkEventHandler(createList);
            worker.RunWorkerAsync(new object());

            while (_workerCompleted == false) GUIWindowManager.Process();
            GUIWaitCursor.Hide();
            
        }

        private void createList(object sender, DoWorkEventArgs e)
        {
            Artists artists = cAmpache.GetAllArtists();
            foreach (Artist item in artists.Items)
            {
                GUIListItem i = new GUIListItem(item.name);
                i.TVTag = item;
                this.facadeView.Add(i);
            }
            _workerCompleted = true;
        }

In a perfect world I would like the to not have the _workerCompleted = true in the createList method..but the most important for the moment was that it worked. :)
 

Users who are viewing this thread

Similar threads

So, you're power cycling the TV, but not putting the PC to sleep ? In General => Startup/Resume settings, try checking "Ignore Windows resolution/size changes" In Codecs and Render, try selecting the specific audio device rather than "Default DirectSound device" Just ideas, no guarantee this will do anything. If this doesn't work, I...
So, you're power cycling the TV, but not putting the PC to sleep ? In General => Startup/Resume settings, try checking "Ignore...
I'm running MP1 as a client only on this: https://www.amazon.com/dp/B0DZX5DWS5?ref_=pe_123509780_1038749300_t_fed_asin_title&th=1...
Replies
4
Views
665
MP1 MP2 Picture-in-picture DE
Can anyone tell me the step-by-step procedure for bringing up a second channel in pip mode? I can only do it sometimes, after many tries, and it’s not clear what I am doing that makes it work on those occasions when it does. Cannot find guidance on the site. Thanks, N. Again, if anyone knows how to do this, would be much...
Can anyone tell me the step-by-step procedure for bringing up a second channel in pip mode? I can only do it sometimes, after many...
Can anyone tell me the step-by-step procedure for bringing up a second channel in pip mode? I can only do it sometimes, after many...
Replies
0
Views
1K
My bad, I misunderstood your post then :) Yeah, these things can get complicated really quickly. I remember scrapping some of my skin-improvement-ideas because I couldn't get these cross-dependencies sorted out.
My bad, I misunderstood your post then :) Yeah, these things can get complicated really quickly. I remember scrapping some of my...
I adjusted the MyMusicPlayingNowInfos.xml for my OldEyes variant of DWHD so it fits without crowding. I now have the issue of text...
Replies
7
Views
2K
I haven't tested it. I use MP1, but sometimes I try to help with MP2 :).
I haven't tested it. I use MP1, but sometimes I try to help with MP2 :).
This happened immediately after my Windows 11 x64 monthly update for November. The update included also cumulative update to .NET...
Replies
9
Views
1K
This is for the tvserver, the iptv part. It used to only support m3u files containing all the channels, but now you can use a m3u8 too. Usually you get an m3u8 from your iptv provider, but there are also some that can be found on the internet
This is for the tvserver, the iptv part. It used to only support m3u files containing all the channels, but now you can use a m3u8...
Hi! I read about [MP1-5236] - Add support for m3u8 files, but I can't find info on how to use this. So, where and how can I use...
Replies
1
Views
965
Top Bottom