[pygtk] Problem with Notebook

John Ehresman jpe at wingware.com
Wed Dec 24 01:05:58 WST 2008


Frédéric wrote:

> As you can see, depending of a config. parameter 
> (self._model.camera.lens.type_), I show a warning saying that the selected 
> TAB can't be used. I would like to stay on the current tab, but as soon as 
> the warning is closed, the selected tab is shown; the 
> self.notebook.set_current_page(1) call does not seem to work. Why ? If I 
> change some widgets, here, it works; why not the Notebook?

This is almost certainly due to being in a signal handler of the 
notebook widget and how the switch-page operation is implemented in the 
gtk notebook C code.  The probable solution is to display the dialog, 
but don't block.  Then switch the page when the dialog is closed.

John


More information about the pygtk mailing list