Re: How to change the overall mousepointer?



Stefan Mueller wrote:

Actually, I just liked to know if there's a way to change the
mousepointer on the whole webpage with only one command and to change
it back afterwards?
^
Yes, that is what you liked to know. (Avoid *asking* *non*-questions, they
are a waste of our time.)

However, I got explained that I shouldn't change the mousepointer to
an hourglass rather I have to see that the function calc() doesn't
need so much time to process.

I fail to see where. Are you sure you are not misinterpreting statements?

Of course that's right, but the function calc() sorts a huge table on the
webpage and that lasts 5 or 10 seconds. The user has to wait until the
table is sorted.

OK. But how can you possibly know how long it takes? Do you know the
runtime environment so exactly? That is unlikely for a "Web page".

Therefore I see it exactly the way like Thomas 'PointedEars' Lahn
wrote in his post "From previous UI experience, when *I* see an
hourglass pointer, I assume that I need to wait, i.e. better not do
anything else, including clicking (YMMV). Therefore, I presume to
signal just that is what was intended here. Nothing more, nothing
less."
That's the only reason why I'd like to show on the whole webpage the
hourglass while the function calc() is doing its job.

However, David was/is correct in pointing out essentially that users are
unpredictable (I did not think it necessary to point out explicitly
everywhere we were in agreement): If a user clicks while the script is
running anyway and the runtime environment cannot cope with it because it is
running a single-threaded script, this can have rather disastrous side
effects (extensive CPU load has been mentioned; browser crashs are possible,
too).

Still, if you set up DOM threads, like

Event listener
|
+- Change cursor
|
+- calc()
Change cursor back

that is, for example

/* or 'wait', but consider tabbed browsing */
window.setTimeout("....cursor = 'progress';", 10);

window.setTimeout("calc(); ....cursor = '';" 10),

there should not be any problem with that, and by contrast to the possible
alternative we discussed (not putting calc() in its own thread, but
preventing input actions to have effect) it should keep the browser and your
Web application responsive.

Reading your posts I'm realizing that it's most probably not possible
to change the cursor to an hourglass on the whole page.

I do not know which posting you have intended to post a follow-up to (you
have not quoted anything == bad), but you posted a follow-up to Garrett's
posting and I do not see anything in his simple question --

Why is calc() so slow?

-- that implies what you ask for cannot be done.

The only ray of hope I found is in the post from David Mark "It's trivial
to change the cursor to wait, non-trivial to disallow all mouse actions
for the document while that cursor is displayed.".

Perhaps you should read more carefully and interpret less. It has been
discussed at great length and in great detail how it can be done. What you
appear to miss is that we also discussed if it should be done (David/me); if
yes, how it can be done best (David/me); and ultimately if it needs to be
done at all (Garrett).

Evidently again, this is not a support forum. We are striving to find the
best solutions to a problem here, not necessarily the quickest answer and
most certainly not the answer that you want to hear.

Is it really so trivial to change the cursor to an hourglass on the
whole webpage?

Yes.

And is it also trivial to change the cursor back to the
shape it was before (crosshair, pointer, ...)?

Yes.

If yes, please give me a hint.

It has been given already.

Learn to post properly. <http://jibbering.com/faq/#posting>


PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
.



Relevant Pages

  • Re: How to change the overall mousepointer?
    ... mousepointer on the whole webpage with only one command and to change ... I got explained that I shouldn't change the mousepointer to ... hourglass pointer, I assume that I need to wait, i.e. better not do ... to change the cursor to an hourglass on the whole page. ...
    (comp.lang.javascript)
  • Re: How to change the overall mousepointer?
    ... mousepointer to an hourglass while the calculations are running. ... cursor. ... They are queued up and there's nothing your script can do ...
    (comp.lang.javascript)
  • Re: VB6 displays differently on different systems
    ... to HTML and webpage scripting. ... Changing the cursor before an operation often ... object -- or explaining where it came from in the code. ...
    (microsoft.public.vb.general.discussion)
  • Re: Long Process
    ... I can change the cursor to an hourglass, ... update the Status Strip on the bottom during the process. ... I need to display this message before it starts the process. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Progress Indicator freezes at a Windows XP config.
    ... I don't think that since the hourglass cursor appears quite random. ... Windows Xp itself. ... Try refreshing just the progressindicator like this ...
    (microsoft.public.vb.controls)