View Full Version : How to add an hourglass thing to a routine?
boesiii
2006-12-14, 01:08 AM
I have a routine that may take along time depending on the input and if it runs long, some users may want to hit escape before it finishes. I would like to add an hourglass type thing to show that the the routine is still running. One idea I had was to keep repeating periods.
Example:
.
..
...
....
Anybody have any others ideas?
I have a routine that may take along time depending on the input and if it runs long, some users may want to hit escape before it finishes. I would like to add an hourglass type thing to show that the the routine is still running. One idea I had was to keep repeating periods.
Example:
.
..
...
....
Anybody have any others ideas?
Maybe a Progress Bar (http://forums.augi.com/showthread.php?t=48534) ?
Or something simple:
(defun wheel ()
(if (not wh)(setq wh "-"))
(cond
((= wh "|") (setq wh "/"))
((= wh "/") (setq wh "-"))
((= wh "-") (setq wh "\\"))
((= wh "\\") (setq wh "|"))
)
(prompt (strcat "\10" wh))
(princ)
)
Example:
(defun c:whatever ()
(while test
(do some stuff.............)
(wheel)
);end while
);end defun
Terry Cadd
2006-12-14, 10:01 PM
I couldn't find an hourglass, but have you considered a progress bar?
Here is the basic code to include in a loop such as a foreach, repeat or while loop.
It is fairly simple to use, as in this small demo below.
(defun c:Demo ( / Test)
(ProgressBar "" "" 0.25)
;The following may also be a foreach or a while loop
(repeat 200 ;This is a redundant example
(repeat 1000 (setq Test pi))
(Progress);Move the Progress Bar
);repeat
(EndProgressBar);Close the Progress Bar
(princ)
);defun c:Demo
vBulletin® v3.6.7, Copyright ©2000-2010, Jelsoft Enterprises Ltd.