Embedding in Tkinter (reprise)

Jeff Epler jepler at unpythonic.net
Tue Jun 25 09:42:47 EDT 2002


You first need to make sure your Python's tkinter is linked with blt.
This can be a bit of a mess ...

Then, guessing, you could start by trying to define a Container class
in Python, something like
    class Container(Widget):
	    def __init__(self, master=None, cnf={}, **kw):
		    Widget.__init__(self, master, 'blt::container', cnf, kw)

Now, the program would look something like
    t = Tk()
    t.tk.call("package", "require", "BLT")
    f = frame(t)
    os.system("xclock &")
    c = Container(f)
    f.pack(fill="both", expand="yes")
    c.pack(fill="both", expand="yes", padx=".1i", pady=".1i")
    c.configure(relief="raised", bd=2, name="xclock")
    t.mainloop()

Jeff





More information about the Python-list mailing list