# Window does not get hidden when it should

**URL:** <https://www.ruby-forum.com/t/window-does-not-get-hidden-when-it-should/260709>\
**Category:** Ruby\
**Tags:** ruby-gnome\
**Created:** [December 27, 2020, 6:37pm UTC](https://www.ruby-forum.com/t/window-does-not-get-hidden-when-it-should/260709 "2020-12-27T18:37:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bartokgyorgy](https://www.ruby-forum.com/user_avatar/www.ruby-forum.com/bartokgyorgy/32/2623_2.png) [@bartokgyorgy](https://www.ruby-forum.com/u/bartokgyorgy)\
**Post date:** [December 27, 2020, 6:37pm UTC](https://www.ruby-forum.com/t/window-does-not-get-hidden-when-it-should/260709/1 "2020-12-27T18:37:51Z")

</div>

> require ‘gtk3’
> 
> app = Gtk::Application.new(“org.monkey.hobotz”, :flags\_none)
> 
> app.signal\_connect “activate” do |application|  
> window = Gtk::ApplicationWindow.new application  
> window.set\_default\_size(300, 10)  
> box = Gtk::Box.new :vertical  
> hidebutton = Gtk::Button.new(label: “Hide”)  
> hidebutton.signal\_connect “clicked” do  
> puts “Let’s hide!!!”  
> window.hide  
> end
> 
> callbutton = Gtk::Button.new(label: “Call”)  
> callbutton.signal\_connect “clicked” do  
> puts “I’m calling you…”  
> window.hide  
> system “gnome-calculator”  
> application.quit  
> end
> 
> window.add box  
> box.add hidebutton  
> box.add callbutton
> 
> window.show\_all  
> end
> 
> app.run

I have this ruby program. Now, when I click hidebutton, the window disappears properly, but after clicking callbutton, it always stays visible after the calculator starts.

For all I know, window.hide happens before the call so it should disappear first and the application calls the other app later.  
What am I missing?
