[Tkinter-discuss] Re: tkinter pmw notebook
klappnase at web.de
Thu Apr 21 00:23:51 CEST 2005
On Wed, 20 Apr 2005 20:30:46 +0200
dimitri pater <dimitri.pater at gmail.com> wrote:
> yes thanks, I have tried the raisecommand, but it doesn't seem to work and I
> can't find any clear examples.
> I am not sure what "the function is called with a single argument, which is
> the name of the selected page." means exactly...
> This is what I do (wrong):
> class Notebook:
> def __init__(self, parent):
> notebook = Pmw.NoteBook(parent, raisecommand=self.refreshDB())
The above line has an error - remove the parentheses.
The name of the selected page, which will be passed as argument to the raisecommand callback
is the name of the page as you defined in the NoteBook.add() method, i.e. in your example
'Project' or 'Database' .
If I understood you correctly, you might do something like this:
def refreshDB(self, pagename):
if pagename == 'Database':
# stuff to refresh the database contents here
I hope this helps
More information about the Tkinter-discuss