Steve Losh avatar Steve Losh committed 3bd1abf

moar docs.

Comments (0)

Files changed (2)

docs/4-reference.markdown

 
 ### lanterna.terminal/get-terminal
 ### lanterna.terminal/start
+
+    :::clojure
+    (start terminal)
+
+Start the given terminal.  Terminals must be started before they can be used.
+
+Consider using [`in-terminal`](#lanternaterminalin-terminal) instead if you
+don't need detailed control of the starting and stopping.
+
 ### lanterna.terminal/stop
+
+    :::clojure
+    (stop terminal)
+
+Stop the given terminal.  Terminals must be stopped after you're done with them,
+otherwise you risk corrupting the user's console.
+
+Don't try to do anything to the Terminal after you stop it.
+
+I'm not sure if you can "restart" a terminal once it's been stopped.  TODO: Find
+out.
+
+Consider using [`in-terminal`](#lanternaterminalin-terminal) instead if you
+don't need detailed control of the starting and stopping.
+
 ### lanterna.terminal/in-terminal
+
+    :::clojure
+    (in-terminal terminal & body)
+
+Start the given terminal, perform the body of expressions, and stop the terminal
+afterward.
+
+This is a macro.
+
+The stopping will be done in a try/finally block, so you can be confident it
+will actually happen.
+
+Use this if you don't need detailed control of the terminal starting and
+stopping process.
+
 ### lanterna.terminal/move-cursor
+
+    :::clojure
+    (move-cursor terminal x y)
+
+Move the cursor to a specific location on the screen.
+
 ### lanterna.terminal/put-character
+
+    :::clojure
+    (put-character terminal ch)
+
+Draw the character at the current cursor location.
+
+Also moves the cursor one character to the right, so a sequence of calls will
+output next to each other.
+
+    :::clojure
+    (put-character terminal ch x y)
+
+Draw the character at the specified cursor location.
+
+Also moves the cursor one character to the right.
+
 ### lanterna.terminal/put-string
 ### lanterna.terminal/set-fg-color
 ### lanterna.terminal/set-bg-color

src/lanterna/terminal.clj

 (defn put-character
   "Draw the character at the current cursor location.
 
-  Moved the cursor one character to the right, so a sequence of calls will
+  If x and y are given, moves the cursor there first.
+
+  Moves the cursor one character to the right, so a sequence of calls will
   output next to each other.
 
   "
-  [terminal ch]
-  (.putCharacter terminal ch))
+  ([terminal ch]
+   (.putCharacter terminal ch))
+  ([terminal ch x y]
+   (move-cursor terminal x y)
+   (put-character terminal ch)))
 
 (defn put-string [terminal s]
   (dorun (map (partial put-character terminal)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.