Hello,
How can I focus an existing Gtk::Window inside my application? A little
example:
########################
require ‘gtk2’
secondwindow = nil
button = Gtk::Button.new(“Click me”)
button.signal_connect(“clicked”){
if secondwindow == nil or secondwindow.destroyed?
secondwindow = Gtk::Window.new
secondwindow.show_all
else
# I want to focus the existing window here
end
}
window = Gtk::Window.new
window.add button
window.show_all
Gtk.main
########################
When you click on the button once, it opens a new Gtk::Window. When you
click on it a second time, I want the existing window to be focused.
Making the second window modal is not an option for me here.
Thanks in advance.