[pygtk] problem with focus in notebook

Rob Brown-Bayliss r.brown.bayliss at gmail.com
Fri Jun 5 15:15:29 WST 2009

On Thu, 2009-06-04 at 08:52 -0400, Mike Bernson wrote:

> Walter Leibbrandt wrote:
> > Mike Bernson wrote:
> >> I have a notebook that I want to control where the focus goes on page 
> >> switches.

Have a similar need to know when a user clicks on a tab to activate the

I place an event box in the tap, and the label in the event box like so:

        evb = gtk.EventBox()
        lab = gtk.Label(self.label)
        evb.connect("button_release_event", self.on_tab_button_pressed)
        # call on user click
        self.page.reparent(self.main_notebook)  # adding page to not
        self.main_notebook.set_tab_label(self.page, evb)  # setting the
        evb as label for page.

Rob Brown-Bayliss

The world at your finger tips...

The reasonable person adapts to the
world; the unreasonable one persists
in trying to adapt
the world to themselves. Therefore,
all progress depends on unreasonable

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20090605/0b317d3d/attachment.htm 

More information about the pygtk mailing list