Skip to content

Commit

Permalink
Minor edits.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Yedidia committed May 31, 2008
1 parent 378ba58 commit d12cc47
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
8 changes: 4 additions & 4 deletions GraphDraw_Nu/nu/main.nu
Expand Up @@ -32,7 +32,7 @@

(- (id) init is
(super init)
;; Set the global variable $graph to give easy access to the graph.
;; Set the global variable $graph to give easy access to the graph.
(set $graph self)
(set @nodes (array))
(set @edges (array))
Expand All @@ -52,7 +52,7 @@
(- (id) initWithFrame: (NSRect) frameRect is
(set self (super initWithFrame:frameRect))
(if (self)
;; Set the global variable $view to give easy access to the view.
;; Set the global variable $view to give easy access to the view.
(set $view self)
(set @backgroundColor (NSColor darkGrayColor))
(set @nodeColor (NSColor redColor))
Expand All @@ -65,8 +65,8 @@
(+ (b second) (/ (b fourth) 2.0)))))
self)

;; The following methods are here so the user can change aspects of
;; the graph from the console or script.
;; The following methods are here so the user can change aspects of
;; the graph from the console or script.
(- (void) setGraph: (id) g is
(set @graph g)
(self setNeedsDisplay:YES))
Expand Down
23 changes: 19 additions & 4 deletions README
@@ -1,18 +1,20 @@
NuGraphDraw

Jonathan Yedidia, May 31, 2008.

This project is a port from PyObjC to Nu, with enhancements, of Aaron Hillegass'
"GraphLaughs" application.

Pre-requisites are Mac OS X Leopard and the Nu programming language, available
at http://programming.nu. Build this application in XCode.
Pre-requisites are Mac OS X Leopard and the Nu programming language, developed by
Tim Burks and available at http://programming.nu. Build this application in XCode.

"GraphLaughs" was described in the June 8, 2006 post of the Big Nerd Ranch weblog
at http://weblog.bignerdranch.com.

This type of application shows off some of the advantages of a dynamic language like Nu.
One can let the user extend the application at run-time with his own scripts.

Aaron writes that "The Python bridge (PyObjC) is still a bit mysterious to me,
Aaron wrote that "The Python bridge (PyObjC) is still a bit mysterious to me,
but I can see that they have done a great job leveraging the dynamic nature of
both languages to make it easy to work with."

Expand Down Expand Up @@ -44,5 +46,18 @@ backgroundColor: (NSColor darkGrayColor)
edgeWidth: 0.9
nodeSize: 6

If you are interested in seeing more Cocoa applications written in Nu, go the
the git repository at
git://github.com/timburks/cocoa-programming-with-nu.git, or look at other examples
posted by Tim Burks at github.com or the examples that come bundled with Nu.


TODO:
Parens-matching in the scriptTextView.
Parens-matching in the scriptTextView.
Better descriptions of script errors.

If you are interested in fixing these problems, fork the repository, then fix
them, and send me a pull request.

Jonathan Yedidia

0 comments on commit d12cc47

Please sign in to comment.