[Tkinter-discuss] Re: tkinter pmw notebook

Martin Franklin mfranklin1 at gatwick.westerngeco.slb.com
Wed Apr 20 16:54:10 CEST 2005


dimitri pater wrote:
> Hello,
> does anybody knows how to automatically refresh the content of a page of 
> a notebook? I have been trying several things, no success.
> 
> Pseudo code:
> 
> class Notebook:
>     def __init__(self, parent):
> 
>         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):
> 
> Now, I use a button on the second page of the notebook, but what I 
> really want is to automatically refresh the page when the user clicks 
> the "Database" tab.
> 

If I remember correctly there is an onraise or onclick option in the
Pmw.NoteBook.__init__ check the source code for the exact spelling
note it will be called for all pages (tabs) when any one of them is
brought to the front.


Martin




More information about the Tkinter-discuss mailing list