Sha256: de9e17afd901e630b774f783dcc0b5892960f6decc9cf2b8509f7989a459bc19
Contents?: true
Size: 623 Bytes
Versions: 7
Compression:
Stored size: 623 Bytes
Contents
module Luck class Alert < Pane attr_accessor :width, :height, :handler def initialize display, width, height, title, controls={}, &blck super display, nil, nil, nil, nil, title, controls, &blck @width, @height = width, height end def x1 (@display.width / 2).to_i - (@width / 2).to_i end def y1 (@display.height / 2).to_i - (@height / 2).to_i end def x2 x1 + @width end def y2 y1 + @height end def on_dismiss &blck @handler = blck end def handle_char char if char == "\n" @handler.call @text if @handler end #redraw end end end
Version data entries
7 entries across 7 versions & 1 rubygems