Cursor wait

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Cursor wait

Ted Bracht-3
Hi
 
I've got a problem with keeping the wait cursor until a number of processes have finished. I set the wait cursor when a button is pressed. The app then goes off and collects data from various places, after which the presenter's model does some calculation with that data and then the presenter is refreshed. This all works fine except that the wait cursor is reset to the arrow cursor long before the data collection is finished. The press button method is like this:
 
Cursor wait showWhile: [self model updateLiveData].
self recalc.
 
This updateLiveData method forks two processes and runs a third process to collect data from other systems. These three processes write logs to another window.
I've tried all kinds of things; set the cursor within the individual collection processes, enforce the cursor to be shown between the processes, but nothing seems to work.
I've checked the current cursor by showing it in the Transcript, and it continues to be the wait cursor, but what I see is the arrow.
 
What can it be? Anybody any other suggestion?
 
Thanks in advance,
 
Ted
Reply | Threaded
Open this post in threaded view
|

Re: Cursor wait

Blair McGlashan
Ted,
 
You wrote in message <A href="news:3f95460f@news.totallyobjects.com">news:3f95460f@......
I've got a problem with keeping the wait cursor until a number of processes have finished. I set the wait cursor when a button is pressed. The app then goes off and collects data from various places, after which the presenter's model does some calculation with that data and then the presenter is refreshed. This all works fine except that the wait cursor is reset to the arrow cursor long before the data collection is finished.
 
The easiest way to achieve what you want is probably to mark the original command associated with the button press as "modal". For menu commands you can set this using the relevant checkbox on the Style tab of the menu item properties dialog. For a button this is not accessible via the ViewComposer's UI (I'll add an enhancement request for that), but you can set it by evaluating an expression such as:
 
    <button> commandDescription isModalCommand: true
 
E.g. in the ViewComposer's published aspect inspector.
 
I've tried all kinds of things; set the cursor within the individual collection processes, enforce the cursor to be shown between the processes, but nothing seems to work.
 
It is best to mark any command which opens subsequent dialogs, or which runs in the background, as modal. This will ensure that the wait cursor is displayed appropriately, and that the originating view is disabled until the command completes.
 
I've checked the current cursor by showing it in the Transcript, and it continues to be the wait cursor, but what I see is the arrow.
 
Setting the global cursor is only effective until something else changes it, so in general you can use mechanisms such as Cursor class>>showWhile: in the context of the main UI process, but not otherwise. You can override the #onGetCursor: method in your Presenter (or a custom view class) should you wish to control the cursor yourself. See the definition in ShellView for an example.
 
Regards
 
Blair
Reply | Threaded
Open this post in threaded view
|

Re: Cursor wait

Ted Bracht-3
Hi Blair,
 
The easiest way to achieve what you want is probably to mark the original command associated with the button press as "modal". For menu commands you can set this using the relevant checkbox on the Style tab of the menu item properties dialog. For a button this is not accessible via the ViewComposer's UI (I'll add an enhancement request for that), but you can set it by evaluating an expression such as:
 
    <button> commandDescription isModalCommand: true
 
E.g. in the ViewComposer's published aspect inspector.
 
 
Works like a charm,
 
Thanks alot
 
Ted