On Tue, Jan 19, 2016 at 10:10:09PM +0100, Johannes Bauer wrote: > I've done some GTK programming in the ancient past and am just now > starting again with GTK3, Glade and pygtk. Wow, the project has come a > long way. It's absolutely amazing and so much simpler than in the past. > I love it.
(I think you mean PyGObject, since PyGTK doesn't support GTK+ 3.x.) > But that aside, I do have a newbie question that I can't seem to figure > out: I have a main application and want to show a different top level > window (let's say it's a "info" window). When the window is opened, I > want it to show and give it the focus (so the user can press enter and > quickly close it down again). But I don't want it modal (it's okay if > the user changes the focus back to the main window and lets the "info" > window open). > > I've tried set_focus() and grab_focus(), but both don't do what I expect > them to do. Surely this is insanely easy, but I couldn't find on the web > how it's done. Can someone give me a hand, please? Isn't info_window.show() doing what you want? Newly-opened windows appear on top and get keyboard focus. If the window was already visible, and you just want to bring it to front, try info_window.present(). The window manager (i.e. gnome-shell) may feel free to ignore your request, on the grounds of focus stealing prevention -- in that case you'll get a notification about the window wanting attention. Regards, Marius Gedminas -- Just a note: quantum gravity discussions are _clearly_ on-topic in c.l.py. -- Peter Hansen on comp.lang.python _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list