When I try to set the 'raisecommand' option in PmwNoteBook, I get this:
TclError Exception in Tk callback
Function: <class __main__.MiscellaneousTables at 0x7756f8> (type: <type 'class'>)
Args: ()
Traceback (innermost last):
File "Pmw.py", line 1772, in __call__
return apply(self.func, args)
File "Window.py", line 98, in __init__
initialization = self.populate()
File "MiscellaneousTablesWindow.py", line 260, in populate
self._makepage(pagename, table['tag'], table['fmt'])
File "MiscellaneousTablesWindow.py", line 705, in _makepage
page.configure(raisecommand=command)
File "/usr/local/lib/python2.2/lib-tk/Tkinter.py", line 1085, in configure
self.tk.call((self._w, 'configure')
TclError: unknown option "-raisecommand"
Here's a code snippet. Please let me know if you need to see more:
--snip--
def command(command=self._enable_buttons, page=pagename):
command(page)
page.configure(raisecommand=command)
--snip--
Any ideas what's going on?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The raisecommand option is an option of a Pmw.NoteBook. It appears that you are passing the option to one of the pages of the notebook rather than the notebook itself. So you need to do something like:
When I try to set the 'raisecommand' option in PmwNoteBook, I get this:
TclError Exception in Tk callback
Function: <class __main__.MiscellaneousTables at 0x7756f8> (type: <type 'class'>)
Args: ()
Traceback (innermost last):
File "Pmw.py", line 1772, in __call__
return apply(self.func, args)
File "Window.py", line 98, in __init__
initialization = self.populate()
File "MiscellaneousTablesWindow.py", line 260, in populate
self._makepage(pagename, table['tag'], table['fmt'])
File "MiscellaneousTablesWindow.py", line 705, in _makepage
page.configure(raisecommand=command)
File "/usr/local/lib/python2.2/lib-tk/Tkinter.py", line 1085, in configure
self.tk.call((self._w, 'configure')
TclError: unknown option "-raisecommand"
Here's a code snippet. Please let me know if you need to see more:
--snip--
def command(command=self._enable_buttons, page=pagename):
command(page)
page.configure(raisecommand=command)
--snip--
Any ideas what's going on?
The raisecommand option is an option of a Pmw.NoteBook. It appears that you are passing the option to one of the pages of the notebook rather than the notebook itself. So you need to do something like:
def _enable_buttons(self, pagename):
print pagename, 'raised'
notebook.configure(raisecommand=self._enable_buttons)
Yep. That's a problem. I'm trying to port some old Pmw code (used NoteBookR) to the new NoteBook.
I may just try to get the old NoteBookR widget working with the new Pmw and later python versions depending on how much work it is. Choices!