Class: RETerm::Components::Dialog

Inherits:
RETerm::Component show all
Includes:
RETerm::CDKComponent
Defined in:
lib/reterm/components/dialog.rb

Overview

CDK Dialog Component

Instance Attribute Summary

Attributes inherited from RETerm::Component

#window

Instance Method Summary collapse

Methods included from RETerm::CDKComponent

#activatable?, #activate!, #colors=, #component, #draw!, #value

Methods inherited from RETerm::Component

#activatable?, #activate!, #colored?, #colors=, #finalize!

Constructor Details

#initialize(args = {}) ⇒ Dialog

Initialize the Dialog component

Parameters:

  • args (Hash) (defaults to: {})

    dialog params

Options Hash (args):

  • :message (String, Array<String>)

    string message(s) to assign to dialog

  • :buttons (String, Array<String>)

    string buttons to assign to dialog



15
16
17
18
19
20
# File 'lib/reterm/components/dialog.rb', line 15

def initialize(args={})
  @message = [args[:message]].flatten.compact
  @buttons = [args[:buttons]].flatten.compact

  @buttons = ["</B/24>OK", "</B16>Cancel"] if @buttons.empty?
end