Program termination problem

John Roth johnroth at ameritech.net
Fri Mar 29 08:00:13 EST 2002


"Garyr" <garyr at fidalgo.net> wrote in message
news:ua6r509m5uradc at corp.supernews.com...
> I have a program that displays a Tkinter Text widget. I would like to
be
> able to place text in the window via the clipboard. I found the
following
> clipboard code in a Google post:
>
> import win32clipboard as clip
>          ...
>         clip.OpenClipboard(0)
>         if clip.IsClipboardFormatAvailable(clip.CF_TEXT):
>            newText = clip.GetClipboardData(clip.CF_TEXT)
>           textwidget.insert(END, newText)
>         clip.CloseClipboard()
>
> This works but it causes the program to hang on exit. mainloop()
returns but
> the DOS window is frozen. The problem is associated with the clipboard
> functions; i.e., commenting the insert line has no effect.
>
> I'm using Python 2.1 (Pythonwin 2.1.211) on Win98.
> Any suggestions?
>
> Thanks in advance,
> Gary Richardson

That's a problem across the board with Tkinter and
Windows. If you check sourceforge, you'll find it on
the bug list. So far, nobody is quite certain whether the
problem is in Windows, Tcl/Tk or Tkinter, and nobody
is working on it, as far as I know.

It only seems to occur if you are using the command
line under Win 9x - it's reported not to be a problem
if you invoke the program from an icon without a
command window.

As far as I can tell, the permanent solution is to use
another graphics package. I'm very patiently waiting
for anygui to become useful...

John Roth
>
>
>
>
>
>
>





More information about the Python-list mailing list