Re: How to change the overall mousepointer?
- From: David Mark <dmark.cinsoft@xxxxxxxxx>
- Date: Tue, 15 Dec 2009 09:50:14 -0800 (PST)
On Dec 15, 12:45 am, Thomas 'PointedEars' Lahn <PointedE...@xxxxxx>
wrote:
David Mark wrote:
Thomas 'PointedEars' Lahn wrote:
David Mark wrote:
On Dec 14, 9:09 pm, Stefan Mueller <seekw...@xxxxxxxxx> wrote:Quite obviously it means that something is happening for which completion
I've a webpage with several tables and a button. If you click theThis is a common UI mistake. The option shouldn't even be available
button the javascript function calc() gets called. This function does
several calculations and now I'm looking for a way to change the
mousepointer to an hourglass while the calculations are running.
to scripts IMO. You should not change _my_ cursor to an hourglass as
(unlike real software), you have no ability to enforce what it means
the user needs to wait.
That is not exactly what it means. It means that nothing will happen
when - for example - you click whatever UI element is presenting that
cursor (e.g. a window). It's as if you didn't click at all.
ISTM you are confusing the issue.
I may be confusing, but I don't think I'm confused.
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).
Well, clicking (or any actions with the mouse) are certainly right
out. The UI programmer makes a conscious decision to display this
cursor and it doesn't always indicate that the app is going to be so
overwhelmed that it can't deal with user input. It just may not make
sense for the app to juggle UI requests with whatever other processing
it is doing. Regardless, mouse actions are discarded while this
cursor is displayed and it does mean wait to the user.
Therefore, I presume to signal
just that is what was intended here. Nothing more, nothing less.
Okay.
(mouse actions are _discarded_).What do you consider to be "mouse actions" and what do they have to do
with the pointer cursor?
Click and what don't they have to do with the pointer cursor?
OK, so clicks are (perhaps) discarded. Isn't that what the hourglass (or
whatever)-shaped wait cursor is supposed to mean, to signal to the user?
Yes. That is exactly the point. You could change the cursor, but
then you would need to somehow prevent all mouse actions while the
wait cursor is present. If you click repeatedly during this long
calculation step, those clicks will be processed after the calculation
is done. They are queued up and there's nothing your script can do
about it as it is doing calculations at the time. Once finished with
the calculations, you change the cursor back and all of those clicks
are processed in turn. How would you stop them is the question. And
it's a minor question, especially when you consider the alternative
timeout-based solution that won't lockup the UI at all. ;)
And clicks have nothing to do with shape of the pointer cursor, of course..
Right. It's trivial to change the cursor to wait, non-trivial to
disallow all mouse actions for the document while that cursor is
displayed.
Clicks - for example - during your monopolization of the browser UIDepends, but why would that preclude the pointer cursor from being
will only be _delayed_.
changed into an appropriate shape, given that the implementation cannot
recognize it in time by itself due to the single-threadedness of script
execution?
But the hourglass (or whatever shape the OS is set to use) is not
appropriate to indicate that clicks will be queued up during the
delay. You might use the hourglass/pointer hybrid for this in a
desktop app.
Usually yes, but it would depend on the use-case.
Right.
In a script, you let the browser/OS handle that.
AISB, the runtime environment cannot recognize that a single-threaded script
is going to take longer than expected until it is too late (and a warning
should be and is issued in some environments, e.g. Gecko); the halting
problem is still undecidable.
I see what you are saying, but if a script goes South for more than a
second or two on this XP Pro box, clicking - for example - FF3.5 may
cause the cursor to change to an hourglass. Repeated clicking may
change the icon in the title bar to the default app icon and resource
usage sometimes goes through the roof. I'm sure these symptoms are
familiar to Windows users.
However, the script itself can cause the cursor change -- to whatever shape
appears be to appropriate for the task, including the hourglass/pointer
hybrid shape you are talking about, with the "progress" property value
Right. Not ashamed to admit I forgot the name of that one (or if it
was even offered). I don't care as I would never use it in a browser
script. :)
But I'm not saying it can't be done "right" if you really want to
present that interface.
-- to
be performed in another DOM thread than the time-consuming part.[1]
BTW, the value for the property reset should be either "" or "auto", not
"default".
Huh?
The proper solution is to break up your calculations into multiple
steps and use timeouts to call each step in turn. Then the user isn't
bothered. Of course, they can still interact with your interface
during the calculations (without delays), which you will have to take
into consideration (perhaps hiding part of _your_ UI until the final
calculation is complete).
One calculation step executed via window.setTimeout() should suffice.
That's as maybe.
I beg your pardon?
Ah, don't apologize.
.
- Follow-Ups:
- Re: How to change the overall mousepointer?
- From: Thomas 'PointedEars' Lahn
- Re: How to change the overall mousepointer?
- References:
- How to change the overall mousepointer?
- From: Stefan Mueller
- Re: How to change the overall mousepointer?
- From: David Mark
- Re: How to change the overall mousepointer?
- From: Thomas 'PointedEars' Lahn
- Re: How to change the overall mousepointer?
- From: David Mark
- Re: How to change the overall mousepointer?
- From: Thomas 'PointedEars' Lahn
- How to change the overall mousepointer?
- Prev by Date: Re: New jQuery announced!
- Next by Date: Re: Auto-scrolling on the iPhone
- Previous by thread: Re: How to change the overall mousepointer?
- Next by thread: Re: How to change the overall mousepointer?
- Index(es):
Relevant Pages
|