Class: GBRb::Graphics::ScreenServer::Window

Inherits:
Object
  • Object
show all
Defined in:
lib/gbrb/graphics/screen_server.rb

Instance Method Summary collapse

Constructor Details

#initialize(incoming) ⇒ Window

Returns a new instance of Window.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/gbrb/graphics/screen_server.rb', line 53

def initialize incoming
  tkroot = TkRoot.new do
  title "GBRb"
    resizable false, false
  end

  display = Display.new tkroot

  Thread.new do
    loop do
      data = incoming.gets
      begin
        display.update_pixels data if data
      rescue RuntimeError => e
        next
      end
    end
  end

  tkroot.mainloop
end