• Re: ttk::progressbar can't be disabled ?

    From Luc@21:1/5 to [email protected] on Mon Jan 15 22:06:23 2024
    On Mon, 15 Jan 2024 16:37:38 -0800 (PST), [email protected] wrote:

    Testing this ( 8.6.11 - Win7 32 )

    package require Tk

    set p [ttk::progressbar .progreso -orient horizontal -mode indeterminate]
    set b [ttk::button .boton -text "Disable pb" -command "$p configure -state >disabled" ] pack $b $p -fill both -expand 1
    $p start 5

    i get this error

    unknown option "-state"
    unknown option "-state"
    while executing
    ".progreso configure -state disabled" (...etc ... )

    It seems like progressbar can't be disabled (however the documentation >doesn't mention this ). Isn't possible set the state of this widget ?

    Alejandro
    **************************

    Maybe this is what you want?

    set p [ttk::progressbar .progreso -orient horizontal -mode indeterminate]
    set b [ttk::button .boton -text "Disable pb" -command "$p stop" ]
    pack $b $p -fill both -expand 1
    $p start 5

    --
    Luc


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luc@21:1/5 to Luc on Mon Jan 15 22:19:25 2024
    On Mon, 15 Jan 2024 22:06:23 -0300, Luc wrote:

    On Mon, 15 Jan 2024 16:37:38 -0800 (PST), [email protected] wrote:

    Testing this ( 8.6.11 - Win7 32 )

    package require Tk

    set p [ttk::progressbar .progreso -orient horizontal -mode indeterminate] >>set b [ttk::button .boton -text "Disable pb" -command "$p configure -state >>disabled" ] pack $b $p -fill both -expand 1
    $p start 5

    i get this error

    unknown option "-state"
    unknown option "-state"
    while executing
    ".progreso configure -state disabled" (...etc ... )

    It seems like progressbar can't be disabled (however the documentation >>doesn't mention this ). Isn't possible set the state of this widget ?

    Alejandro
    **************************

    Maybe this is what you want?

    set p [ttk::progressbar .progreso -orient horizontal -mode indeterminate]
    set b [ttk::button .boton -text "Disable pb" -command "$p stop" ]
    pack $b $p -fill both -expand 1
    $p start 5

    **************************

    Also, note that the correct way of setting the state of a progress bar is
    $p state disabled

    You don't use -configure


    So you could do this:

    set p [ttk::progressbar .progreso -orient horizontal -mode indeterminate]
    set b [ttk::button .boton -text "Disable pb" -command "$p state disabled; puts \"state now is [$p state disabled]\""]
    pack $b $p -fill both -expand 1
    puts "state is [$p state disabled]"
    $p start 5


    Now, what purpose this 'state' command ever serves in a progress bar is
    beyond me.

    --
    Luc


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luc@21:1/5 to [email protected] on Tue Jan 16 01:24:17 2024
    On Mon, 15 Jan 2024 19:14:08 -0800 (PST), [email protected] wrote:

    Hi Luc,

    actually i want to disabled it, not stop it.
    Using your example, i got first
    state is
    and after click in the button
    state now is !disabled

    by the way, the progressbar remains enabled all time.

    Saludos,
    Alejandro
    **************************

    What do you mean by "disabled"?

    I don't know what a disabled progress bar is.


    --
    Luc


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to [email protected] on Wed Jan 17 02:44:24 2024
    [email protected] <[email protected]> wrote:
    What do you mean by "disabled"?
    I don't know what a disabled progress bar is

    Well, is like a disabled button ... but with progressbar.
    May be this is a silly question but jokes aside, is still valid.
    Saludos,
    Alejandro

    Except that "disabled" is an odd state to reason about for a "progress
    bar".

    Buttons are active items that accept user interaction (click on
    button). "Disablement" for a button makes sense as it prevents
    "activation" of the button until it is later enabled.

    A progress bar (at least a normal one) is a "one-way" widget. It
    conveys information to a user, but there is usually no "interaction"
    from the user (no clicking on the bar to do something). Therefore,
    with no "interaction", there is nothing to "disable", and setting it to "disabled" is an odd state to ask about.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to [email protected] on Wed Jan 17 05:12:47 2024
    [email protected] <[email protected]> wrote:
    El martes, 16 de enero de 2024 a la(s) 11:44:28 p.m. UTC-3, Rich escribió:

    Buttons are active items that accept user interaction (click on
    button). "Disablement" for a button makes sense as it prevents
    "activation" of the button until it is later enabled.

    Ok, but what about labels then ?.
    You can to configure the state of labels to "disabled" or "readonly", for example.
    How the user interact with a label ?
    Odd?. May be. But you can disable a label if you want ...

    Ok, that's fair. No interaction with a label, but it can still be
    disabled.

    And..., I should have consulted the docs before replying previously:

    For ttk widgets, disablement is one of the "state" flags that is
    controled by the 'state' sub-command, not by 'configure -state' like
    with traditional Tk widgets:

    $ rlwrap wish
    % ttk::progressbar .pb
    .pb
    % .pb state
    % .pb state disabled
    !disabled
    % .pb state
    disabled
    %

    Read about it in the progressbar man page and the ttk::widget man page.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Bjornsdottirs - Ellenor@21:1/5 to Rich on Thu Jan 18 06:38:04 2024
    On Wed, 17 Jan 2024 02:44:24 -0000 (UTC), Rich wrote:

    [email protected] <[email protected]> wrote:
    What do you mean by "disabled"?
    I don't know what a disabled progress bar is

    Well, is like a disabled button ... but with progressbar.
    May be this is a silly question but jokes aside, is still valid.
    Saludos,
    Alejandro

    Except that "disabled" is an odd state to reason about for a "progress
    bar".

    Buttons are active items that accept user interaction (click on button).
    "Disablement" for a button makes sense as it prevents "activation" of
    the button until it is later enabled.

    A progress bar (at least a normal one) is a "one-way" widget. It
    conveys information to a user, but there is usually no "interaction"
    from the user (no clicking on the bar to do something). Therefore, with
    no "interaction", there is nothing to "disable", and setting it to
    "disabled" is an odd state to ask about.

    Disabled progress bars are sometimes used if a task has finished or is suspended. They should be shown differently to non-disabled progress bars.

    Sometimes, progress bars are overlaid with an invisible slider widget. (I
    don't recommend this, it's hard to get right.) Disabled would mean
    disabling that invisible slider, in that case.

    --
    Ellenor Bjornsdottir <[email protected]> Pan makes it quite difficult to
    set a multi-line signature. Some say it should be that way. Most of those people already have us on their killfile.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luc@21:1/5 to The Bjornsdottirs - Ellenor on Thu Jan 18 14:12:06 2024
    On Thu, 18 Jan 2024 06:38:04 -0000 (UTC), The Bjornsdottirs - Ellenor wrote:

    Disabled progress bars are sometimes used if a task has finished or is >suspended. They should be shown differently to non-disabled progress bars.

    Sometimes, progress bars are overlaid with an invisible slider widget. (I >don't recommend this, it's hard to get right.) Disabled would mean
    disabling that invisible slider, in that case.


    Your words make sense to me, but the whole won't until someone explains
    how that "disabled" state is different from a stopped progress bar.


    --
    Luc


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)