zenity/progress_darwin.go
2021-04-27 14:09:30 +01:00

21 lines
429 B
Go

package zenity
import (
"strconv"
"github.com/ncruces/zenity/internal/zenutil"
)
func progress(opts options) (ProgressDialog, error) {
var env []string
if opts.title != nil {
env = append(env, "description="+*opts.title)
}
if opts.maxValue == 0 {
opts.maxValue = 100
}
if opts.maxValue >= 0 {
env = append(env, "total="+strconv.Itoa(opts.maxValue))
}
return zenutil.RunProgress(opts.ctx, opts.maxValue, env)
}