Pmw blt problem

Gary Richardson garyr at fidalgo.net
Sun Sep 2 03:48:53 CEST 2001


This code fragment (from Pmw.Blt documentaion):

from Tkinter import *
import Pmw
master = Tk()
if not Pmw.Blt.haveblt(master):     # is Blt installed?
   print("BLT is not installed!")
else:
    g = Pmw.Blt.Graph( master )
    g.pack( expand=1, fill='both' )
    vector_x = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
    vector_y = (5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5)
    g.line_create( "f(x)=abs(x-5)", xdata=vector_x, ydata=vector_y )
    master.mainloop()

works, but only once. If I attempt to run it a second time I get the
following:
>>>
Traceback (most recent call last):
  File "C:\Python21\Pythonwin\pywin\framework\scriptutils.py", line 301, in
RunScript
    exec codeObject in __main__.__dict__
  File "C:\My Documents\Python\Blt\hello.py", line 8, in ?
    g = Pmw.Blt.Graph( master )
  File "c:\python21\Pmw\Pmw_0_8_5\lib\PmwBlt.py", line 260, in __init__
    Tkinter.Widget.__init__(self, master, _graphCommand, cnf, kw)
  File "c:\python21\lib\lib-tk\Tkinter.py", line 1758, in __init__
    self.tk.call(
TclError: invalid command name "::blt::graph"

This also happens if I run Python from a DOS prompt. In both cases I have to
exit Python and start over.

Here is what I did to install BLT (based on several posts to c.l.p):

1) Installed BLT in the c:\python21\tcl directory as c:\python21\tcl\blt...

2) Moved the blt dll's (BLT24.dll, BLTlite24.dll) to c:\windows\system and
the blt lib files (BLT24.lib, BLTlite24.lib) to c:\python21\tcl

3) Copied the c:\python21\tcl\blt\lib\blt2.4 directory to
c:\python21\tcl\tcl8.3.

I found a post to c.l.p on 29 March 01 describing the this same problem but
there were no replies. Can someone tell me what I've done wrong or what
the fix is?

I'm using the PythonWin IDE, ActivePython build 2.1.211.

Thanks in advance
Gary Richardson

















































More information about the Python-list mailing list