Lisp HUG Maillist Archive

Indeterminate progress bar

Hi,

Does anyone know of a way in CAPI to display an activity indicator for a process of unknown duration?

Some Mac applications display an indeterminate progress bar, which is like a barber's pole, but I can't find any interface to it in CAPI.

Thanks!
David Johnson-Davies

+------------------------------------------------------------+
David Johnson-Davies, Human-Computer Interface Ltd
17 Signet Court, Swanns Road, Cambridge, CB5 8LA, England.

Tel: +44 1223 314934, Fax: +44 1223 462562
Email: david@interface.co.uk, Web: http://www.interface.co.uk/
+------------------------------------------------------------+


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Indeterminate progress bar

I have code for doing just that, placed into the repository Data-Objects at

https://github.com/dbmcclain/data-objects

file is called Progress-bar.lisp

- DM



On Jan 8, 2013, at 08:28 AM, David Johnson-Davies <david@interface.co.uk> wrote:

> 
> Hi,
> 
> Does anyone know of a way in CAPI to display an activity indicator for a process of unknown duration?
> 
> Some Mac applications display an indeterminate progress bar, which is like a barber's pole, but I can't find any interface to it in CAPI.
> 
> Thanks!
> David Johnson-Davies
> 
> +------------------------------------------------------------+
> David Johnson-Davies, Human-Computer Interface Ltd
> 17 Signet Court, Swanns Road, Cambridge, CB5 8LA, England.
> 
> Tel: +44 1223 314934, Fax: +44 1223 462562
> Email: david@interface.co.uk, Web: http://www.interface.co.uk/
> +------------------------------------------------------------+
> 
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
> 
> 

Dr. David McClain
CTO & Co-Founder
Acudora (TM)
e-mail: david@acudora.com
Tel: (+1) 520-529-2437




_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Indeterminate progress bar

Hi,

If you are on Mac, you can hook into the underlying widget, like this:

(defun progress-bar-set-indeterminate (progress-bar indeterminate)
  (let ((pb-obj (slot-value (slot-value (slot-value progress-bar 'capi::implementation)
                                               'capi-internals:representation) 'capi-cocoa-library::main-view)))
          (objc:invoke pb-obj "setIndeterminate:" (if indeterminate 1 0))
          (when indeterminate
            (objc:invoke pb-obj "startAnimation:" nil))))

For some reason, animation does not work when I just tested it now with capi:contain:

(let ((progress-bar (capi:contain (make-instance 'capi:progress-bar :start 0 :end 100))))
  (progress-bar-set-indeterminate progress-bar t))

But it may have something to do with threading. It works in my production code anyway.

Regards
Erik



8 jan 2013 kl. 16:28 skrev David Johnson-Davies:

> 
> Hi,
> 
> Does anyone know of a way in CAPI to display an activity indicator for a process of unknown duration?
> 
> Some Mac applications display an indeterminate progress bar, which is like a barber's pole, but I can't find any interface to it in CAPI.
> 
> Thanks!
> David Johnson-Davies
> 
> +------------------------------------------------------------+
> David Johnson-Davies, Human-Computer Interface Ltd
> 17 Signet Court, Swanns Road, Cambridge, CB5 8LA, England.
> 
> Tel: +44 1223 314934, Fax: +44 1223 462562
> Email: david@interface.co.uk, Web: http://www.interface.co.uk/
> +------------------------------------------------------------+
> 
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
> 


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Updated at: 2020-12-10 08:36 UTC