Class: Niente::App

Inherits:
Drawable show all
Defined in:
lacci/lib/scarpe/niente/app.rb

Instance Attribute Summary

Attributes inherited from Drawable

#children, #parent, #shoes_linkable_id, #shoes_type

Attributes inherited from Shoes::Linkable

#linkable_id

Instance Method Summary collapse

Methods inherited from Drawable

#add_child, #remove_child, #set_parent

Methods inherited from Shoes::Linkable

#bind_shoes_event, #send_self_event, #send_shoes_event, #unsub_all_shoes_events, #unsub_shoes_event

Constructor Details

#initialize(properties) ⇒ App

Returns a new instance of App.



5
6
7
8
9
10
11
# File 'lacci/lib/scarpe/niente/app.rb', line 5

def initialize(properties)
  super

  bind_shoes_event(event_name: "init") { init }
  bind_shoes_event(event_name: "run") { run }
  bind_shoes_event(event_name: "destroy") { destroy }
end

Instance Method Details

#destroyObject



31
32
# File 'lacci/lib/scarpe/niente/app.rb', line 31

def destroy
end

#initObject



13
14
# File 'lacci/lib/scarpe/niente/app.rb', line 13

def init
end

#runObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lacci/lib/scarpe/niente/app.rb', line 16

def run
  send_shoes_event("return", event_name: "custom_event_loop")

  @do_shutdown = false
  bind_shoes_event(event_name: "destroy") do
    @do_shutdown = true
  end

  at_exit do
    until @do_shutdown
      Shoes::DisplayService.dispatch_event("heartbeat", nil)
    end
  end
end