Permalink
Browse files

Show the #inspect string of the context's object as the window title.

  • Loading branch information...
1 parent 19eed0b commit 4046244530cd4bf5a64b3338dfb3b3e6fc612dc2 @alloy committed Aug 3, 2010
Showing with 7 additions and 1 deletion.
  1. +0 −1 TODO
  2. +2 −0 lib/irb/cocoa/view_controller.rb
  3. +5 −0 lib/irb/cocoa/window_controller.rb
View
1 TODO
@@ -1,5 +1,4 @@
* Colorize string in input field as you type
-* Use the context’s object description as the window title
* Clicking a line in an exception BT should show the code in that file, somehow. Or if it's code entered in the console, show that.
* Make border of input field red as long as there's a syntax error. Possibly see if another color can be used to indicate the source ‘indent’ level.
* Think about selectable areas / copy support
@@ -8,6 +8,7 @@ class IRBViewController < NSViewController
INPUT_FIELD_HEIGHT = 22
attr_reader :output
+ attr_reader :context
def initWithObject(object, binding: binding, delegate: delegate)
if init
@@ -245,6 +246,7 @@ def addToHistory(line)
def receivedResult(result)
addConsoleNode(ObjectNode.nodeForObject(result))
+ @delegate.receivedResult(self)
makeInputFieldPromptForInput
scrollWebViewToBottom
end
@@ -26,10 +26,15 @@ def initWithObject(object, binding: binding)
if initWithWindow(window)
@viewController = IRBViewController.alloc.initWithObject(object, binding: binding, delegate: self)
window.contentView = @viewController.view
+ receivedResult(@viewController)
self
end
end
+ def receivedResult(viewController)
+ window.title = viewController.context.object.inspect
+ end
+
def clearConsole(sender)
@viewController.clearConsole(sender)
end

0 comments on commit 4046244

Please sign in to comment.