require 'Context/Views/PageView' require 'Context/Gtk/Key' require 'Context/Gtk/Widget' require 'gtk2' module Context::Gtk class PageView < Context::PageView class MainWindow < Gtk::Window def initialize(title, view) super(title) @view = view connectSignals unless @view.nil? end def connectSignals signal_connect('destroy') do closeView end end def closeView @view.close end end attr_reader :mainWindow def initialize(context, title="No Title") super(context) @mainWindow = MainWindow.new(title, self) @mainWindow.set_default_size(600, 400) @widget = Context::Gtk::Widget.new(@mainWindow) end def open @mainWindow.show_all @mainWindow.grab_focus end def getWidget @widget end def emitDestroyEvent @mainWindow.signal_emit("destroy") end end end