require 'gtk' window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL) hbox = Gtk::HBox.new(false, 0) button1 = Gtk::Button.new('Hello World') button2 = Gtk::Button.new('button2') hbox.pack_start button1, true, true, 0 hbox.pack_start button2, true, true, 0 window.add hbox button1.show button2.show hbox.show window.show Gtk.main