Interactive use of Tk

varner at PENELOPE.CHEM.UIC.EDU varner at PENELOPE.CHEM.UIC.EDU
Mon Aug 2 15:53:30 EDT 1999


Thanks Alexander.  I've been suffering from this problem for a while.
But now I have a similar problem with Pmw.  Here's a tiny class that
displays the problem (and not much else).

### 
from Tkinter import *
import Pmw

class no_graph (Tk):
    def __init__ (self):
        Tk.__init__ (self)
        Pmw.initialise (self)
        self.graph = Pmw.Blt.Graph (self, title = "No Data")
        self.graph.pack ()

        button = Button (self, text = "Quit", command = self.destroy)
        button.pack ()

    def destroy (self):
        self.withdraw ()
        Tk.destroy (self)
        self.quit ()
###

Interactively, the second time I call no_graph (), I get:

Traceback (innermost last):
  File "<stdin>", line 1, in ?
  File "no_data.py", line 8, in __init__
    self.graph = Pmw.Blt.Graph (self, title = "No Data")
  File "/usr/local/lib/python1.5/site-packages/Pmw/Pmw_0_8/lib/PmwBlt.py", line 215, in __init__
    Tkinter.Widget.__init__(self, master, _graphCommand, cnf, kw)
  File "/usr/local/lib/python1.5/lib-tk/Tkinter.py", line 1084, in __init__
    self.tk.call(
TclError: invalid command name "::blt::graph"

I'm guessing I have to quit Pmw before I reinitialize, but I don't
know how.  Does anyone know of a good online reference for Pmw or Blt?
Thanks.

-- 
Sam Varner
SEL 2210 (MC 111)
Department of Chemistry
University of Illinois at Chicago




More information about the Python-list mailing list