correct values for Progress Bar

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

correct values for Progress Bar

Günther Schmidt
Hi all,

sorry but what kind of value are your supposed to pass the progress bar?

I thought it was a fraction but it seems to be an interval rather.

How are you supposed to use it?

Günther


Reply | Threaded
Open this post in threaded view
|

Re: correct values for Progress Bar

Chris Uppal-3
Günther,

> sorry but what kind of value are your supposed to pass the progress bar?
>
> I thought it was a fraction but it seems to be an interval rather.

It expects its model to be a value model containing integers.  The Interval is
used for the #range:

E.g.  using the default model:

    presenter := NumberPresenter show: 'Progress bar'.
    presenter topShell extent: 800@50. "just so we can see what we're doing"
    presenter view range: (0 to: 1000).

    "then"
    presenter value: 230.

Or using an explicit model:

    model := 0 asValue.
    presenter := NumberPresenter show: 'Progress bar' on: model.
    presenter topShell extent: 800@50.
    presenter view range: (0 to: 1000).

    model value: 230.

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: correct values for Progress Bar

Günther Schmidt
Thanks Chris,

that works!


Chris Uppal schrieb:

> Günther,
>
>> sorry but what kind of value are your supposed to pass the progress bar?
>>
>> I thought it was a fraction but it seems to be an interval rather.
>
> It expects its model to be a value model containing integers.  The Interval is
> used for the #range:
>
> E.g.  using the default model:
>
>     presenter := NumberPresenter show: 'Progress bar'.
>     presenter topShell extent: 800@50. "just so we can see what we're doing"
>     presenter view range: (0 to: 1000).
>
>     "then"
>     presenter value: 230.
>
> Or using an explicit model:
>
>     model := 0 asValue.
>     presenter := NumberPresenter show: 'Progress bar' on: model.
>     presenter topShell extent: 800@50.
>     presenter view range: (0 to: 1000).
>
>     model value: 230.
>
>     -- chris
>
>