Class: CcInputBox

Inherits:
FlexCocoa show all
Defined in:
lib/flex_cocoa/cc_input_box.rb

Instance Attribute Summary

Attributes inherited from FlexCocoa

#exec, #output

Instance Method Summary collapse

Methods inherited from FlexCocoa

#button_response, #buttons_template, #parts_init, #post_initialize, set_path

Constructor Details

#initialize(title, question, prompt = '', r_button = 'Ok', m_button = nil, l_button = nil) ⇒ CcInputBox

Returns a new instance of CcInputBox.



9
10
11
12
13
14
15
16
# File 'lib/flex_cocoa/cc_input_box.rb', line 9

def initialize (title, question, prompt = '', r_button = 'Ok', m_button = nil, l_button = nil)
  super()

  buttons_template('inputbox', title, prompt, question, r_button, m_button, l_button)
  post_initialize
  response = @stdout.read.strip.split("\n")
  @output = {button: response[0], response: response[1]}
end