Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > How to change the overall mousepointer?

Reply
Thread Tools

How to change the overall mousepointer?

 
 
Stefan Mueller
Guest
Posts: n/a
 
      12-16-2009
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?
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. 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.

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.

Reading your posts I'm realizing that it's most probably not possible
to change the cursor to an hourglass on the whole page. 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.".
Is it really so trivial to change the cursor to an hourglass on the
whole webpage? And is it also trivial to change the cursor back to the
shape it was before (crosshair, pointer, ...)? If yes, please give me
a hint.
 
Reply With Quote
 
 
 
 
David Mark
Guest
Posts: n/a
 
      12-16-2009
On Dec 15, 9:50*pm, Stefan Mueller <(E-Mail Removed)> wrote:

[...]

> 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.".
> Is it really so trivial to change the cursor to an hourglass on the
> whole webpage? And is it also trivial to change the cursor back to the
> shape it was before (crosshair, pointer, ...)?


Well, perception is reality here. Cover the whole document with a
transparent DIV with a wait cursor. Remove it when done. You could
even use it to rebuff mouse actions by stopping their propagation.
Still, keyboard input will be queued until after the calculation is
done, which doesn't gibe with the wait signal.
 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      12-16-2009
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Best overall reporting package? Paul Ritchie ASP .Net 4 10-27-2008 07:54 PM
Does bridging reduce overall speed? Gregg Hill Wireless Networking 1 04-24-2005 07:36 PM
RE: 'Overall' Editing DataGrids Mike Moore [MSFT] ASP .Net 2 11-12-2003 05:27 PM
Overall editing DataGrids Sebi ASP .Net 0 11-12-2003 09:52 AM



Advertisments