lib/screens/base.rb in manabu-desktop-0.0.1 vs lib/screens/base.rb in manabu-desktop-0.0.2
- old
+ new
@@ -1,14 +1,14 @@
-require_relative '../toolbox'
+require_relative '../tools'
require 'gtk3'
module ManabuDesktop
module Screens
class Base
attr_accessor :window, :builder
- def initialize(layout)
+ def initialize(layout, locale = :c)
@builder = Gtk::Builder.new()
@builder.add_from_file("#{__dir__}/../../layouts/#{layout}.glade")
@builder.connect_signals do |handler|
begin
@@ -18,15 +18,17 @@
method('not_yet_implemented')
end
end
@window = builder.get_object("#{layout}.window")
- @window.signal_connect('delete-event') { |_widget| Gtk.main_quit }
+ @window.signal_connect('delete-event') do |_widget|
+ @window.destroy()
+ Gtk.main_quit()
+ end
end
def _show()
@window.show()
-
Gtk.main()
end
end
end
end