Tix Vs Pmw which is better to use?

Maric MICHAUD maric.michaud at cirec.com
Mon May 27 09:55:17 EDT 2002


Sorry, i miss this post till now, 

I did this for a program written in python wich was printing his output
on stdout.

For me the better is to use thread.
The solution that satisfy me was to redefine sys.stdout object for the
thread to point on one of my own app widget with write and flush
functions.
Beware to not use update call for your gui in Tk from a child thread,
this is not safe and crash randomly, use after_idle instead.

-----Message d'origine-----
De : Cimarron Taylor [mailto:cimarron+google at taylors.org]
Envoyé : jeudi 2 mai 2002 13:05
À : python-list at python.org
Objet : Re: Tix Vs Pmw which is better to use?

Now a question for the group.  I would like to add to my interface a
text area which would contain the output of a separate long running make
process I need to spawn.  I can't just call system() as that would block
the entire ui (unless I setup a separate thread).  I've tried using
fork()
and exec() but that seems to cause an X server error which kills the
entire
application. 

The best thing I've found so far is to run the separate process in an 
xterm window by creating an instance of the following class:

  class StartMake:
     def __init__(self, target):
        os.popen('xterm -e make %s &' % target)

I know there are probably a few paths I could start down:

  a. use threads (yeah I know, but seems like overkill for this)
  b. get a window id of a Tkinter widget and have xterm use that window
(yuck!)
  c. use a Tkinter alarm to poll the tail of a file containing the make
output
     (this is what I might end up doing, but seems clumsy)

Any suggestions?

Cim
-- 
http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list