Way to hide pinwheel cursor?

Hi everyone,
At the moment I am working on a small experiment, and this is an even smaller problem.
This is sort of like the problem discussed in https://forum.xojo.com/23634-automatic-pinwheel-cursor/ earlier this summer, but maybe not quite identical, and I’m hoping it’s different enough that there is actually an answer for me than is different from “live with it.” :slight_smile:

In my experiment, I am hiding the cursor except for when the subject needs to click on a button to continue. Other than that, there is no need at all for them to be using the mouse and I wish to eliminate the temptation. (The experiment occupies the entire screen; the subject ideally never sees anything else but the experiment screen.)

I am using Me.MouseCursor=System.Cursors.invisiblecursor to turn the cursor off and self.MouseCursor=System.Cursors.StandardPointer to make it visible again at the appropriate time.

My experiment has several “phases” (learning, testing, learning, testing) between which I am playing a bit of music as a break between the phases. I had to put in a timer for the music because otherwise while the music was playing the next stage (instruction screen for next phase) would come on prematurely. (Maybe that is my problem; I need to find a different way to make the program wait for the music to stop before going on?)

Anyway, similarly to the problem discussed in the other forum post (he was doing animation effects), the system sees the program not doing anything, and turns on the pinwheel (and the force quit page shows the app as not responding).

I’d really prefer not to have the pinwheel, but in my case it is maybe not as bad as with the animation; I could just have the subjects be told to expect the pinwheel at that point so that they don’t think there is a problem. It does go away when the music ends and the page changes to the next one in the experiment.

Or, someone on the other thread suggested “update your software to run with the latest version of the system in ways recommended by Apple to avoid the beachball (timer)” – I’m not sure which software should be updated or what else I might do to meet Apple’s recommendations of how to avoid the beach ball.

FTR, I am running OS X 10.10.2 and Xojo 2015 Rel 2.4


So how exactly are you making the program wait?

When I reach the end of an experiment phase, I set that window to not be visible and set the interphase (musical interlude) window to visible. In the open for the interphase window I make sure the cursor is invisible and then call a timer (with a period of 100, so, very short) that then starts the music [not 100% sure why I did that; but at some earlier point I was having problems, and in the process tried this and it works]. Then I have a while/wend:
while mysound.IsPlaying
to ensure the program doesn’t proceed until the music is done (so my description above may be based on faulty memory of something I tried at one point but gave up) and then I set another timer that, when it goes off, switches to the next instruction page. [I’m not sure if I need that second timer, but I have had issues both in the past, possibly in old RB, and in working on this program, with parts of my code proceeding before I’m ready; and I’ve fixed it by throwing in a timer… though while I’m just thinking about it and not programming, I’d think the while/wend should handle it. Need to try that.] In several places I am telling the cursor to be invisible even though it probably should be invisible already, including at the beginning of the interphase musical interlude, and at the beginning of the instruction page (I don’t want the cursor on immediately), but I’m not doing anything special while the music is playing. (Would inserting that code into the while/wend do it? would that be too weird?)

(Long story short: switch windows, set cursor invisible, short timer, play music with while/wend, different timer, switch windows to next window.)

(“window” == screen in my experiment. In various experiments I have successfully written I have tried using several panels in one window, or even just everything on one panel… in this experiment I did not go that direction. I may have even tried to do those things and it just worked better to switch windows; I know in one recent effort that I was having some very bad results with panels so I switched away from them. The only downside of a separate window for each screen is a brief “flash” of underlying desktop of the computer as it switches. I know from other things I’ve read here that I have to live with that. unless someone has good ideas about getting rid of that flash! But probably too late to make major changes such as switching back to panels; this is almost ready to roll, just checking the latin square logic and choosing the final stimuli…)

My understanding from the other thread (about the animation) is that this pinwheel appearance when the program is “idle” for even a few seconds may be a “feature” of OS X, but I’m still hoping that someone will suggest some ingenious way of getting around this.

thanks, Carolyn

Update, just tried: The second timer is not needed, but if I don’t have it I need to make sure that my music clips have an agreeable few microseconds of silence at the end so that the jump isn’t sudden. The second timer currently ensures that. Since I’m going to be creating a full set of clips for the actual experiment [current set is only for testing so shorter than will be used] I can do that and get rid of the second timer.

Also, adding the line to make the cursor invisible within the while/wend did not change anything.

The while/wend is probably the reason for the wait cursor. Holding an event for longer than a second is a sure recipe for getting the beachball.

Instead, you should use a multiple timer that simply checks the state of your sound at regular intervals. Maybe every 17 ms (1/60th a second), and calls the next phase when the sound is over.

Thank you, Michel, I will give that a try.

Michel: bingo! voila! beautiful! I am using shorter snippets of music as of last night (so as not to bore my tester who will have to run this over and over) but it’s still 10 s long, and the pinwheel used to appear almost immediately. [in the real experiment, I will use snippets of 2-3 minutes, but for testing…] Now, nary a peep from the pinwheel, at least on the computer on which I program. Thank you!
(I am now off to test it on one of the computers on which the experiment will actually be run; still a Mac, but some differences… and it worked well there too)