Tkinter, main loop question.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Exod

    #1

    Tkinter, main loop question.

    Don't know if its possible in this light-weight GUI toolset, but can i
    somehow hook up into the mainloop in it, for example if i were to
    create an internet application, i would need to keep recieving data
    from within it?

  • Hendrik van Rooyen

    #2
    Re: Tkinter, main loop question.

    "Exod" <ratbasher@gmai l.comwrote:

    Don't know if its possible in this light-weight GUI toolset, but can i
    somehow hook up into the mainloop in it, for example if i were to
    create an internet application, i would need to keep recieving data
    from within it?
    Its possible - use the call back mechanism to implement a ticker or stutter
    thread, remembering that you cant block here, because then the gui stops.

    If its a good idea is another question, because sockets wants to be the main
    thread too.

    but if you fire up another process for the comms, and use threads in front of
    pipes, with queues to the ticker in the main loop, it works. Just don't call any
    gui stuff from threads in the same process, only from the ticker or stutter
    thread.

    - Hendrik


    Comment

    • Bjoern Schliessmann

      #3
      Re: Tkinter, main loop question.

      Exod wrote:
      Don't know if its possible in this light-weight GUI toolset, but
      can i somehow hook up into the mainloop in it, for example if i
      were to create an internet application, i would need to keep
      recieving data from within it?
      That's something where you could try the Twisted framework
      (http://twistedmatrix.com). Its event loop integrates with many GUI
      toolkits', also Tk's.

      Regards,


      Björn

      --
      BOFH excuse #394:

      Jupiter is aligned with Mars.

      Comment

      Working...