Tkinter, main loop question.

Discussion in 'Python' started by Exod, Nov 23, 2006.

  1. Exod

    Exod Guest

    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?
     
    Exod, Nov 23, 2006
    #1
    1. Advertising

  2. "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?


    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
     
    Hendrik van Rooyen, Nov 23, 2006
    #2
    1. Advertising

  3. 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.
     
    Bjoern Schliessmann, Nov 23, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John M
    Replies:
    1
    Views:
    1,192
    Kumar Reddi
    May 29, 2005
  2. Hal Styli
    Replies:
    14
    Views:
    1,650
    Old Wolf
    Jan 20, 2004
  3. Frederick Ding

    int main() or int main(void)?

    Frederick Ding, Dec 3, 2005, in forum: C Programming
    Replies:
    10
    Views:
    656
  4. Ravi
    Replies:
    17
    Views:
    929
    Kenneth Brody
    Apr 1, 2006
  5. Isaac Won
    Replies:
    9
    Views:
    387
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page