Tkinter from Vis. BASIC

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terrance N. Phillip

    #1

    Tkinter from Vis. BASIC

    In VB, an easy way I indicate progress is something like
    do while <some process is not met>
    lblNotify.foreg round = randomcolor
    lblNotify.refre sh <-----------
    <sleep>
    loop

    I want to do the same thing in Python/Tkinter:

    # Wait for network to recognize the workstation:
    while os.system("slis t") != 0:
    self.notify["fg"] = randcolor()
    # how do I refresh label l3 at this point?
    time.sleep(3)

    I've tried self.notify.gri d() (I'm using the grid geometry manager
    throughout), but that didn't work, and there is no redraw() or refresh()
    method that I can see.
  • jmdeschamps@gmail.com

    #2
    Re: Tkinter from Vis. BASIC


    Terrance N. Phillip wrote:[color=blue]
    > In VB, an easy way I indicate progress is something like
    > do while <some process is not met>
    > lblNotify.foreg round = randomcolor
    > lblNotify.refre sh <-----------
    > <sleep>
    > loop
    >
    > I want to do the same thing in Python/Tkinter:
    >
    > # Wait for network to recognize the workstation:
    > while os.system("slis t") != 0:
    > self.notify["fg"] = randcolor()
    > # how do I refresh label l3 at this point?
    > time.sleep(3)
    >
    > I've tried self.notify.gri d() (I'm using the grid geometry manager
    > throughout), but that didn't work, and there is no redraw() or refresh()
    > method that I can see.[/color]

    I know of an update_idletask () method, look it up in the tkinter doc to
    see if that's what you need!

    Comment

    • jmdeschamps@gmail.com

      #3
      Re: Tkinter from Vis. BASIC


      Terrance N. Phillip wrote:[color=blue]
      > In VB, an easy way I indicate progress is something like
      > do while <some process is not met>
      > lblNotify.foreg round = randomcolor
      > lblNotify.refre sh <-----------
      > <sleep>
      > loop
      >
      > I want to do the same thing in Python/Tkinter:
      >
      > # Wait for network to recognize the workstation:
      > while os.system("slis t") != 0:
      > self.notify["fg"] = randcolor()
      > # how do I refresh label l3 at this point?
      > time.sleep(3)
      >
      > I've tried self.notify.gri d() (I'm using the grid geometry manager
      > throughout), but that didn't work, and there is no redraw() or refresh()
      > method that I can see.[/color]

      I know of an update_idletask () method, look it up in the tkinter doc to
      see if that's what you need!

      Comment

      • Terrance N. Phillip

        #4
        Re: Tkinter from Vis. BASIC

        jmdeschamps@gma il.com wrote:
        [color=blue][color=green]
        >>I want to do the same thing in Python/Tkinter:
        >>
        >> # Wait for network to recognize the workstation:
        >> while os.system("slis t") != 0:
        >> self.notify["fg"] = randcolor()
        >> # how do I refresh label l3 at this point?
        >> time.sleep(3)[/color][/color]
        [color=blue]
        > I know of an update_idletask () method, look it up in the tkinter doc to
        > see if that's what you need!
        >[/color]
        Thanks. I did a dir(label_objec t) and saw update() and
        update_idletask s(). updeate() seems to do the trick.

        Comment

        • Terrance N. Phillip

          #5
          Re: Tkinter from Vis. BASIC

          jmdeschamps@gma il.com wrote:
          [color=blue][color=green]
          >>I want to do the same thing in Python/Tkinter:
          >>
          >> # Wait for network to recognize the workstation:
          >> while os.system("slis t") != 0:
          >> self.notify["fg"] = randcolor()
          >> # how do I refresh label l3 at this point?
          >> time.sleep(3)[/color][/color]
          [color=blue]
          > I know of an update_idletask () method, look it up in the tkinter doc to
          > see if that's what you need!
          >[/color]
          Thanks. I did a dir(label_objec t) and saw update() and
          update_idletask s(). updeate() seems to do the trick.

          Comment

          Working...