Class: Context::Gtk::App

Inherits:
Context show all
Defined in:
lib/Context/Gtk/App.rb

Instance Attribute Summary collapse

Attributes inherited from Context

#mainView, #parent, #viewBridge

Instance Method Summary collapse

Methods inherited from Context

#addView, #createViews, #destroyViews, #isEntered?, #onExit, #peekAtView, #setupViews

Constructor Details

#initialize(namespace, context) ⇒ App

Returns a new instance of App.



10
11
12
13
14
15
# File 'lib/Context/Gtk/App.rb', line 10

def initialize(namespace, context)
  viewBridge = Context::Bridge.new(namespace)
  super(viewBridge)
  Gtk.init
  @mainContext = context.new(viewBridge)
end

Instance Attribute Details

#mainContextObject (readonly)

Returns the value of attribute mainContext.



8
9
10
# File 'lib/Context/Gtk/App.rb', line 8

def mainContext
  @mainContext
end

Instance Method Details

#enterObject



17
18
19
20
21
# File 'lib/Context/Gtk/App.rb', line 17

def enter
  super(nil)
  @mainContext.enter(self)
  Gtk.main
end

#exitObject



23
24
25
26
# File 'lib/Context/Gtk/App.rb', line 23

def exit
  super()
  Gtk.main_quit
end