Sha256: 878cf30e60a5bdd59a605b371b5aee9e4026785c1dde46a6c3102e2ed8e556ce

Contents?: true

Size: 740 Bytes

Versions: 1

Compression:

Stored size: 740 Bytes

Contents

require_relative '../toolbox'
require 'gtk3'

module ManabuDesktop
  module Screens
    class Base
      attr_accessor :window, :builder

      def initialize(layout)
        @builder = Gtk::Builder.new()
        @builder.add_from_file("#{__dir__}/../../layouts/#{layout}.glade")

        @builder.connect_signals do |handler|
          begin
            method(handler)
          rescue
            puts "#{handler} not yet implemented!"
            method('not_yet_implemented')
          end
        end

        @window = builder.get_object("#{layout}.window")
        @window.signal_connect('delete-event') { |_widget| Gtk.main_quit }
      end

      def _show()
        @window.show()

        Gtk.main()
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
manabu-desktop-0.0.1 lib/screens/base.rb