Class: WorkOn::MacTerminal::MacWindow
- Inherits:
-
Window
- Object
- Window
- WorkOn::MacTerminal::MacWindow
- Defined in:
- lib/work_on/terminals/mac_terminal.rb
Instance Method Summary collapse
-
#initialize(terminal, process, appscript) ⇒ MacWindow
constructor
A new instance of MacWindow.
- #new_tab ⇒ Object
-
#select! ⇒ Object
Selects this window.
- #selected? ⇒ Boolean
- #tabs ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(terminal, process, appscript) ⇒ MacWindow
Returns a new instance of MacWindow.
52 53 54 55 56 |
# File 'lib/work_on/terminals/mac_terminal.rb', line 52 def initialize(terminal, process, appscript) @terminal = terminal @process = process @appscript = appscript end |
Instance Method Details
#new_tab ⇒ Object
76 77 78 79 80 81 82 |
# File 'lib/work_on/terminals/mac_terminal.rb', line 76 def new_tab prev = @terminal.selected_window self.select! @process.keystroke('t', :using => :command_down) prev.select! self.tabs.last end |
#select! ⇒ Object
Selects this window
NOTE: This is not publicly exported since it is only used on the mac Where i need to send keystrokes to the process, so i need to be able to control the currently selected window
68 69 70 |
# File 'lib/work_on/terminals/mac_terminal.rb', line 68 def select! @appscript.frontmost.set(true) end |
#selected? ⇒ Boolean
58 59 60 |
# File 'lib/work_on/terminals/mac_terminal.rb', line 58 def selected? @appscript.frontmost.get end |
#tabs ⇒ Object
72 73 74 |
# File 'lib/work_on/terminals/mac_terminal.rb', line 72 def tabs @appscript.tabs.get.map {|tab| MacTab.new @terminal, tab } end |
#to_s ⇒ Object
84 85 86 |
# File 'lib/work_on/terminals/mac_terminal.rb', line 84 def to_s @appscript.id_.get end |