#!/usr/bin/ruby -w
# Encoding: UTF-8
# frozen_string_literal: true
# =========================================================================== #
require 'gtk_paradise/require_gtk3'
require 'gtk_paradise/project/project.rb'

Gtk::Settings.default.gtk_font_name = 'Hack 25'

alias e puts

window = Gtk::Window.new
notebook = Gtk.notebook
notebook.set_scrollable(true)
# notebook.the_tabs_appear_on_top

require_these_files = Dir[
  Gtk.project_base_directory?+'/examples/gtk3/**/**.rb'
]

require_these_files.each {|this_ruby_file|
  short_name = File.basename(this_ruby_file).sub(/\.rb$/,'') # e. g. "colourized_button_example"
  case short_name
  when 'small_paned_example'
    require 'gtk_paradise/examples/gtk3/'+short_name+'.rb'
    notebook.append_page(
      ::Gtk::SmallPanedExample.new,
      ::Gtk::Label.new('1')
    )
  else
    e short_name+' is currently not handled by this file.'
  end
}

window.add(notebook)
window.move(0, 0)
window.set_size_request(800, 400)
window.show_all
Gtk.main