> Sylvain Thenault <[EMAIL PROTECTED]> writes:
>
> hello, 
> 
> does anybody knows how to give the focus to a particular window using
> pygtk ? (I wish the designed window to take focus and to come to the
> foreground if another window hided it).
> 
> I'm using gtk+ 1.2.8 and pygtk 0.6.6
> 
> TIA
> 
> -- 
> Sylvain Thenault
> 
>   LOGILAB           http://www.logilab.org

    def showDialog(self, dialogName, title = None):
        d = self.wtree.get_widget(dialogName)
        if title:
            d.set_title(title)
        if d.flags(gtk.MAPPED) == 0:
            d.show()
        else:
            d.get_window()._raise()
            # call map again so dialogs will refresh their contents
            return d.emit('map', d)

I don't mess with the focus, probably bad manners even if the window 
manager lets you do it, but you can probably add 

            d.grab_focus() to the above code.

-- 
Steve McClure                   430 10th St NW
Racemi                          Suite N-210
http://www.racemi.com           Atlanta, GA 30318
[EMAIL PROTECTED]             voice/fax: 404-892-5850


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to