29 lines
319 B
Ruby
29 lines
319 B
Ruby
require "set"
|
|
|
|
class Window
|
|
|
|
include Widget
|
|
|
|
@windows = Set.new
|
|
|
|
class << self
|
|
def register(window)
|
|
@windows << window
|
|
end
|
|
|
|
def remove(window)
|
|
@windows.delete(window)
|
|
end
|
|
end
|
|
|
|
def initialize
|
|
Window.register(self)
|
|
super
|
|
end
|
|
|
|
def close
|
|
Window.remove(self)
|
|
end
|
|
|
|
end
|