Class: CcMessageBox

Inherits:
FlexCocoa show all
Defined in:
lib/flex_cocoa/cc_message_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, subtitle, message, r_button, m_button = nil, l_button = nil) ⇒ CcMessageBox

Returns a new instance of CcMessageBox.



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/flex_cocoa/cc_message_box.rb', line 9

def initialize (title, subtitle, message, r_button, m_button = nil, l_button = nil)
  super()
  @exec << " msgbox"
  @exec << " --title \"#{title}\" --text \"#{subtitle}\""
  @exec << " --informative-text \"#{message}\""
  @exec << " --button1 \"#{r_button}\""
  @exec << " --button2 \"#{m_button}\"" unless m_button.nil?
  @exec << " --button3 \"#{l_button}\"" unless l_button.nil?

  post_initialize
  response = @stdout.read.strip
  @output = response.to_i - 1
end