Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating Rule “use-auto-wait-cursor-on-your-windows-application/rule” #8237

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions rules/use-auto-wait-cursor-on-your-windows-application/rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
type: rule
title: Do you use AutoWaitCursor on Windows applications?
uri: use-auto-wait-cursor-on-your-windows-application
authors:
- title: Adam Cogan
url: https://ssw.com.au/people/adam-cogan/
created: 2014-03-14T02:02:00.000Z
guid: 4aa7ca6d-e9fe-4d11-933a-bf2095c4efe4

---

It can be extremely tiresome to have to continually remember to set and unset the wait cursor for an application. If an exception occurs you have to remember to add a try finally block to restore the cursor, or if you popup a message box you must remember to change the cursor first otherwise the user will just sit there thinking the application is busy.

<!--endintro-->

::: bad
![Figure: Bad example - Cursor set manually](autowaitcursor_bad.jpg)
:::

::: good
![Figure: Good example - Implemented AutoWaitCursor](autowaitcursor_good.jpg)
:::

AutoWaitCursor Class automatically monitors the state of an application and sets and restores the cursor according to whether the application is busy or not. All that required are a few lines of setup code and you are done. [See this great blog on how to use AutoWaitCursor](http://snipplr.com/view/24851/). If you have a multithreaded application, it won't change the cursor unless the main input thread is blocked. In fact, you can remove all of your cursor setting code everywhere!
Loading