summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-04-04 17:59:23 -0400
committerPietro Gagliardi <[email protected]>2014-04-04 17:59:23 -0400
commit1b05312da9f940a89c19dd33bfc4eaafa481fcd7 (patch)
treec70b8818d9075890975f5b57867ca3446867c5f6
parent3a130b756a74c24ea34a1d25a86c96c72da2d80f (diff)
Mac OS X indeterminate progresbars were not animating under certain conditions; fix that.
-rw-r--r--sysdata_darwin.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdata_darwin.go b/sysdata_darwin.go
index 05eabf1..40c9480 100644
--- a/sysdata_darwin.go
+++ b/sysdata_darwin.go
@@ -479,6 +479,8 @@ func (s *sysData) setProgress(percent int) {
defer close(ret)
uitask <- func() {
if percent == -1 {
+ // At least on Mac OS X 10.8, if the progressbar was already on 0 or 100% when turning on indeterminate mode, the indeterminate animation won't play, leaving just a still progress bar. This is a workaround. Note the selector call order.
+ C.objc_msgSend_double(s.id, _setDoubleValue, C.double(50))
C.objc_msgSend_bool(s.id, _setIndeterminate, C.BOOL(C.YES))
} else {
C.objc_msgSend_bool(s.id, _setIndeterminate, C.BOOL(C.NO))