Esempio n. 1
0
func (pb ProgressBar) Create(parent walk.Container) error {
	w, err := walk.NewProgressBar(parent)
	if err != nil {
		return err
	}

	return InitWidget(pb, w, func() error {
		w.SetRange(pb.MinValue, pb.MaxValue)
		w.SetValue(pb.Value)

		if pb.AssignTo != nil {
			*pb.AssignTo = w
		}

		return nil
	})
}
Esempio n. 2
0
func (pb ProgressBar) Create(builder *Builder) error {
	w, err := walk.NewProgressBar(builder.Parent())
	if err != nil {
		return err
	}

	return builder.InitWidget(pb, w, func() error {
		w.SetRange(pb.MinValue, pb.MaxValue)
		w.SetValue(pb.Value)

		if pb.AssignTo != nil {
			*pb.AssignTo = w
		}

		return nil
	})
}