If you create a Tix NoteBook in python, calling pages() will fail if the notebook has only one page:
>>> from Tix import *
>>> root = Tk()
>>> n = NoteBook(root)
>>> p1 = n.add("page1", label="page 1")
>>> n.pack()
>>> n.pages()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/cadappl/python/2.5.1/python/lib/python2.5/lib-tk/Tix.py", line 1163, in pages
ret.append(self.subwidget(x))
File "/cadappl/python/2.5.1/python/lib/python2.5/lib-tk/Tix.py", line 337, in subwidget
raise TclError, "Subwidget " + name + " not child of " + self._name
_tkinter.TclError: Subwidget p not child of 3065096
It works correctly in tcl (returns a 1-element list).
You can contact me at daniel.rawson@asml.com
Logged In: NO
Yes, I had a same problem.
The function pages() is following:
def pages(self):
# Can't call subwidgets_all directly because we don't want .nbframe
names = self.tk.split(self.tk.call(self._w, 'pages'))
ret = []
for x in names:
ret.append(self.subwidget(x))
return ret
When the NoteBook has some pages, type of the value 'name' above is list, but when the NoteBook has only one page, type of the value 'name' is a string.Then, in the next loop process, x is a charactor instead of page name, and the function call "self.subwidget(x)" will be faild.
My e-mail address is jkani4@gmail.com.