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


Write your reply...

Similar threads

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
878
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
561
Actually I solved this myself. I did have the correct driver (it was the only one which would work). But on the drivers download page, there was an additional item called "TBS6281se V2 Change Mode Tool". There was zero documentation to accompany this. I downloaded it and ran it. It is a tool to detect the current run state of both...
Actually I solved this myself. I did have the correct driver (it was the only one which would work). But on the drivers download...
My previous TBS PCI-E card failed, so I bought another one. The model I chose is the TBS 6181-SE, which can be seen on Amazon here...
Replies
2
Views
392
Well, I had already recognized your problem, but I still wanted to point out the basic connections once again. Unfortunately, I don't have a fundamentally different solution for you, but with this approach you should achieve your goal. ;) The idea of first setting the current genre colors with the defines is certainly a good one, as...
Well, I had already recognized your problem, but I still wanted to point out the basic connections once again. Unfortunately, I...
Good afternoon, Does anyone know a way of referencing the genre colour of the currently selected item in the TV Guide. We are all...
Replies
4
Views
730
Ok, thanks much. I will look into the instructions above. For the moment, I turned off the "Automatic channel logo update" in Settings (which somehow I had missed, I think because it wasn't an option previously), and the deleted everything in the Flat-default folder and populated it with my own logos. Works, so far.
Ok, thanks much. I will look into the instructions above. For the moment, I turned off the "Automatic channel logo update" in...
Hi-- I have to revisit an old issue, unfortunately. I just downloaded MP 2.5, a fresh installation, on a new computer (reluctantly...
Replies
5
Views
311
Top Bottom