dimitri pater wrote:
Hello,
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...



The function name you bind to the raisecommand will be called when you raise a page of the notebook and at the same time the name of the page will be sent to it


This is what I do (wrong):
class Notebook:
    def __init__(self, parent):

notebook = Pmw.NoteBook(parent, raisecommand=self.refreshDB())

Here is one problem, you are calling self.refreshDB() remove the () and it will bind the name of that method to the raisecommand



        notebook.pack(fill = 'both', expand = 1, padx = 10, pady = 10)

        page = notebook.add('Project')

page = notebook.add('Database')
b = Tkinter.Button(self.frame2, text='Refresh', width=25, underline=0, command=self.refreshDB)
b.pack(side="left", padx=2, pady=2)


    def refreshDB(self):



 Change this to :
      def refreshDB(self, pageName):
          if pageName=="My Interesting Page":
              ## do somthng interesting


Thanks for you help!
Dimitri

On 4/20/05, *Stewart Midwinter* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Grayson's book 'Python & Tkinter Programming'  says that there is a
    raisecommand option for Notebook:

    "Specifies a function to call when a new page is selected. the
    function is called with a single argument, which is the name of the
    selected page.



Thanks Stuart I was away from a python'ised machine when I wrote my
original reply

Cheers
Martin

_______________________________________________
Tkinter-discuss mailing list
[email protected]
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to