Source / clojure-lanterna / index.html

<!DOCTYPE html>
        <link rel="stylesheet" href="./_dmedia/bootstrap.css"/>
        <link rel="stylesheet" href="./_dmedia/tango.css"/>
        <link rel="stylesheet/less" type="text/css" href="./_dmedia/style.less">
        <script src="./_dmedia/less.js" type="text/javascript">
    <body class="index">
        <div class="wrap">
            <header><h1><a href="">clojure-lanterna</a></h1></header>
                <div class="markdown">
<p>clojure-lanterna is a thin wrapper around the <a href="">Lanterna</a> Java library to make
it more Clojure-friendly.</p>
<p><strong>It's still pre-1.0, so expect brokenness and backwards incompatibility.  Once
it hits 1.0 you can be confident I'll stop breaking your shit all the time.</strong></p>
<p><strong>License:</strong> GNU Lesser GPL (yes, you can link with code under another license!)<br />
<strong>Documentation:</strong> <a href=""></a><br />
<strong>Issues:</strong> <a href=""></a><br />
<strong>Git:</strong> <a href=""></a><br />
<strong>Mercurial:</strong> <a href=""></a></p>
<h2 id="what-is-it">What is It?</h2>
<p><a href="">Lanterna</a> is a Java library for interacting with terminals.  It's kind of
like curses, except it's pure Java so it'll run anywhere.  It lets you move the
cursor around, draw colored text, and so on.</p>
<p>It also contains a simple Swing "terminal emulator", so you can run your code
either in the terminal or in a separate Swing window when you don't have
a real terminal available (inside an IDE or on a certain terrible OS).</p>
<p>It's particularly nice for writing Roguelikes.</p>
<h2 id="how-to-use-it">How to Use It</h2>
<p>There are three main layers to Lanterna.  Currently clojure-lanterna supports
the first two layers of Lanterna: Terminal and Screen.  At some point support
may be added for the GUI layer, but not any time soon.</p>
<p>To get started:</p>
<p>Read the <a href="">first page</a> of the <a href="">Lanterna
   documentation</a>.  It sums up some main concepts and things
   you'll need to watch out for.</p>
<p>Come back here and read the <a href="./installation/">Installation</a> docs to get
   clojure-lanterna on your machine.</p>
<p>Read the <a href="./terminals/">Terminal</a> and <a href="./screens/">Screen</a> documents here in
<p>Have fun!  Consult the <a href="./reference/">Reference</a> document if you need more
   detailed information about something.  Most functions also have docstrings.</p>
<h2 id="i-want-a-hello-world">I Want a Hello, World!</h2>
<p>Okay, fine:</p>
<div class="codehilite"><pre><span class="p">(</span><span class="nf">require</span> <span class="o">&#39;</span><span class="p">[</span><span class="nv">lanterna.screen</span> <span class="ss">:as</span> <span class="nv">s</span><span class="p">])</span>

<span class="p">(</span><span class="k">def </span><span class="nv">scr</span> <span class="p">(</span><span class="nf">s/get-screen</span><span class="p">))</span>

<span class="p">(</span><span class="nf">s/stop</span> <span class="nv">screen</span><span class="p">)</span>

<span class="p">(</span><span class="nf">s/put-string</span> <span class="nv">scr</span> <span class="mi">10</span> <span class="mi">10</span> <span class="s">&quot;Hello, world!&quot;</span><span class="p">)</span>
<span class="p">(</span><span class="nf">s/put-string</span> <span class="nv">scr</span> <span class="mi">10</span> <span class="mi">11</span> <span class="s">&quot;Press any key to exit!&quot;</span><span class="p">)</span>
<span class="p">(</span><span class="nf">s/get-key-blocking</span><span class="p">)</span>

<span class="p">(</span><span class="nf">s/stop</span> <span class="nv">screen</span><span class="p">)</span>

<p>But really, please read the docs if you actually want to use this.  They're not
that long.</p><h2>Table of Contents</h2><ol class="toc"><li><a href="installation/">Installation</a></li><li><a href="terminals/">Terminals</a></li><li><a href="screens/">Screens</a></li><li><a href="reference/">Reference</a></li><li><a href="changelog/">Changelog</a></li></ol>
            <footer><p>Created by <a href="">Steve Losh</a>.
Documentation created with <a href="">d</a>.</p>
<p><br/><a id='rochester-made' href='' title='Rochester Made'><img src='' alt='Rochester Made' title='Rochester Made' /></a></p>
<script type="text/javascript">
  var _gauges = _gauges || [];
  (function() {
    var t   = document.createElement('script');
    t.type  = 'text/javascript';
    t.async = true;    = 'gauges-tracker';
    t.setAttribute('data-site-id', '4f843f8c613f5d65280000e6');
    t.src = '//';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(t, s);