Odd progress bar window behaviour

RoboFont Forums Help / General Odd progress bar window behaviour

Tagged: ,

This topic contains 2 replies, has 2 voices, and was last updated by  Roberto Arista 5 years, 5 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6158

    Roberto Arista
    Participant

    Hi Frederik, Hi RoboFont users,
    I am working on a progress bar window to use inside an extension for processes that requires more than a bunch of seconds to be accomplished.

    I’d like to have in this window some indicators more than just the progress bar, like percentage, process description, time counter and so on.

    So, this is the first version of the progress bar that I wrote:
    https://gist.github.com/roberto-arista/e2f82669cff09c64960a

    But if you run it, you can easily notice that percentage and time counter do not update.
    At least not in my Robofont or Drawbot installations.

    Instead, if I hide and show the window each cycle of the for loop, the two textBox objects are updated:
    https://gist.github.com/roberto-arista/ee737aa745d776f84a22

    What’s happening here?
    Am I doing something wrong?

    Thanks

    #6159

    frederik
    Keymaster

    Due to optimisations a text will not update directly cause it is receiving lots of updates in a short time.

    You will have to force the text view to update

    see https://github.com/typesupply/defconAppKit/blob/master/Lib/defconAppKit/windows/progressWindow.py#L27-L31

    instead of using the private _nsObject I would encourage you to use getNSTextField()

    good luck

    #6160

    Roberto Arista
    Participant

    It works!
    Thanks :)

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.