[Tkinter-discuss] Problem running Tix from Python 2.4
Michael Lange
klappnase at web.de
Mon Jan 10 20:56:35 CET 2005
On Mon, 10 Jan 2005 17:56:52 -0000
"Mark English" <Mark.English at liffe.com> wrote:
Hi Mark,
you forgot to initialize tix by calling Tix.Tk() instead of Tkinter.Tk().
>
> C:\temp> python
> Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on
> win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import Tkinter
> >>> import Tix
> >>> root = Tkinter.Tk()
^^^^^^^
> >>> feb = Tix.FileSelectBox(root)
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "C:\Python24\Lib\lib-tk\Tix.py", line 791, in __init__
> TixWidget.__init__(self, master, 'tixFileSelectBox', ['options'],
> cnf, kw)
> File "C:\Python24\Lib\lib-tk\Tix.py", line 307, in __init__
> self.tk.call(widgetName, self._w, *extra)
> _tkinter.TclError: invalid command name "tixFileSelectBox"
>
In fact you don't need to import Tkinter separately, you can simply
do an "import Tix" and prefix all standard Tkinter widgets with Tix
(Tix.Button etc.) or do "from Tix import *" and use the standard widgets
as usual (Tix.py itself does a "from Tkinter import *").
I hope this helps
Michael
More information about the Tkinter-discuss
mailing list