Note that there are some explanatory texts on larger screens.

plurals
  1. POVery simple, terse and easy GUI programming “frameworks”
    text
    copied!<p>Please list GUI programming libraries, toolkits, frameworks which allow to write GUI apps <em>quickly</em>. I mean in such a way, that</p> <ul> <li>GUI is described entirely in a human-readable (and human-writable) plain text file (code)</li> <li>code is terse (1 or 2 lines of code per widget/event pair), suitable for scripting</li> <li>structure and operation of the GUI is evident from the code (nesting of widgets and flow of events)</li> <li>details about <em>how</em> to build the GUI are hidden (things like mainloop, attaching event listeners, etc.)</li> <li>auto-layouts are supported (vboxes, hboxes, etc.)</li> </ul> <p>As answers suggest, this may be defined as <em>declarative</em> GUI programming, but it is not necessarily such. Any approach is OK if it works, is easy to use and terse.</p> <p>There are some GUI libraries/toolkits like this. They are listed below. Please extend the list if you see a qualifying toolkit missing. Indicate if the project is crossplatform, mature, active, and give an example if possible.</p> <p>Please use this wiki to discuss <em>only Open Source</em> projects. </p> <p>This is the list so far (in alphabetical order):</p> <h3>Fudgets</h3> <p><a href="http://www.md.chalmers.se/Cs/Research/Functional/Fudgets/Intro/ex2.html" rel="noreferrer">Fudgets</a> is a Haskell library. Platform: Unix. Status: Experimental, but still maintained. An example:</p> <pre><code> import Fudgets main = fudlogue (shellF "Hello" (labelF "Hello, world!" &gt;+&lt; quitButtonF)) </code></pre> <p><a href="http://www.picamatic.com/show/2009/01/28/02/40/1883597_93x80.gif" rel="noreferrer">Fudgets example screenshot http://www.picamatic.com/show/2009/01/28/02/40/1883597_93x80.gif</a></p> <h3>GNUstep Renaissance</h3> <p><a href="http://www.gnustep.it/Renaissance/Screenshots.html" rel="noreferrer">Renaissance</a> allows to describe GUI in simple XML. Platforms: OSX/GNUstep. Status: part of GNUstep. An example below:</p> <pre><code>&lt;window title="Example"&gt; &lt;vbox&gt; &lt;label font="big"&gt; Click the button below to quit the application &lt;/label&gt; &lt;button title="Quit" action="terminate:"/&gt; &lt;/vbox&gt; &lt;/window&gt; </code></pre> <p><a href="http://www.picamatic.com/show/2009/01/28/03/19/1884098_289x80.png" rel="noreferrer">Renaissance example screenshot http://www.picamatic.com/show/2009/01/28/03/19/1884098_289x80.png</a></p> <h3>HTML</h3> <p>HTML-based GUI (HTML + JS). Crossplatform, mature. Can be used entirely on the client side.</p> <p>Looking for a nice “helloworld” example.</p> <p><a href="http://www.picamatic.com/show/2009/01/28/02/44/1883635_264x60.png" rel="noreferrer">HTML GUI example http://www.picamatic.com/show/2009/01/28/02/44/1883635_264x60.png</a></p> <h3>JavaFX</h3> <p><a href="http://hackety.org/2007/05/09/soGooeyCanYouSeeTheButton.html" rel="noreferrer">JavaFX</a> is usable for standalone (desktop) apps as well as for web applications. Not completely crossplatform, not yet completely open source. Status: 1.0 release. An example:</p> <pre><code> Frame { content: Button { text: "Press Me" action: operation() { System.out.println("You pressed me"); } } visible: true } </code></pre> <p><em>Screenshot is needed.</em></p> <h3>Phooey</h3> <p><a href="http://www.haskell.org/haskellwiki/Phooey#One_example.2C_two_interfaces" rel="noreferrer">Phooey</a> is another Haskell library. Crossplatform (wxWidgets), HTML+JS backend planned. Mature and active. An example (a little more than a helloworld):</p> <pre><code> ui1 :: UI () ui1 = title "Shopping List" $ do a &lt;- title "apples" $ islider (0,10) 3 b &lt;- title "bananas" $ islider (0,10) 7 title "total" $ showDisplay (liftA2 (+) a b) </code></pre> <p><a href="http://www.picamatic.com/show/2009/01/28/02/33/1883543_236x187.png" rel="noreferrer">Phooey example screenshot http://www.picamatic.com/show/2009/01/28/02/33/1883543_236x187.png</a></p> <h3>PythonCard</h3> <p><a href="http://pythoncard.sourceforge.net/index.html" rel="noreferrer">PythonCard</a> describes GUI in a Python dictionary. Crossplatform (wxWidgets). Some apps use it, but the project seems stalled. There is an active fork.</p> <p><em>I skip <a href="http://www.halfcooked.com/presentations/osdc/pythoncard.html" rel="noreferrer">PythonCard example</a> because it is too verbose for the contest.</em></p> <p><a href="http://www.picamatic.com/show/2009/01/28/02/46/1883646_199x99.gif" rel="noreferrer">PythonCard example screenshot http://www.picamatic.com/show/2009/01/28/02/46/1883646_199x99.gif</a></p> <h3>Shoes</h3> <p><a href="http://shoooes.net/tutorial/" rel="noreferrer">Shoes</a> for Ruby. Platforms: Win/OSX/GTK+. Status: Young but active. A minimal app looks like this:</p> <pre><code> Shoes.app { @push = button "Push me" @note = para "Nothing pushed so far" @push.click { @note.replace "Aha! Click!" } } </code></pre> <p><a href="http://www.picamatic.com/show/2009/01/28/03/14/1884011_227x71.png" rel="noreferrer">Shoes example screenshot http://www.picamatic.com/show/2009/01/28/03/14/1884011_227x71.png</a></p> <h3>Tcl/Tk</h3> <p><a href="http://wiki.tcl.tk/488" rel="noreferrer">Tcl/Tk</a>. Crossplatform (its own widget set). Mature (probably even dated) and active. An example:</p> <pre><code> #!/usr/bin/env wish button .hello -text "Hello, World!" -command { exit } pack .hello tkwait window . </code></pre> <p><a href="http://www.picamatic.com/show/2009/01/28/02/51/1883672_111x58.png" rel="noreferrer">Tcl/Tk example screenshot http://www.picamatic.com/show/2009/01/28/02/51/1883672_111x58.png</a></p> <h3>tekUI</h3> <p><a href="http://tekui.neoscientists.org/" rel="noreferrer">tekUI</a> for Lua (and C). Platforms: X11, DirectFB. Status: Alpha (usable, but API still evolves). An example:</p> <pre><code> #/usr/bin/env lua ui = require "tek.ui" ui.Application:new { Children = { ui.Window:new { Title = "Hello", Children = { ui.Text:new { Text = "_Hello, World!", Style = "button", Mode = "button", }, }, }, }, }:run() </code></pre> <p><a href="http://www.picamatic.com/show/2009/01/28/03/01/1883821_290x55.png" rel="noreferrer">tekUI helloworld screenshot http://www.picamatic.com/show/2009/01/28/03/01/1883821_290x55.png</a></p> <h3>Treethon</h3> <p><a href="http://code.google.com/p/treethon/" rel="noreferrer">Treethon</a> for Python. It describes GUI in a YAML file (<em>Python in a YAML tree</em>). Platform: GTK+. Status: work in proress. A simple app looks like this:</p> <pre><code> _import: gtk view: gtk.Window() add: - view: gtk.Button('Hello World') on clicked: print view.get_label() </code></pre> <p><a href="http://treethon.googlecode.com/svn/trunk/treethon_gtk_tutorial/base.png" rel="noreferrer">Treethon helloworld screenshot http://treethon.googlecode.com/svn/trunk/treethon_gtk_tutorial/base.png</a></p> <h3>Yet unnamed Python library by Richard Jones:</h3> <p>This one is not released yet. The idea is to use Python context managers (<code>with</code> keyword) to structure GUI code. See <a href="http://www.mechanicalcat.net/richard/log/Python/Something_I_m_working_on.3" rel="noreferrer">Richard Jones' blog</a> for details.</p> <pre><code>with gui.vertical: text = gui.label('hello!') items = gui.selection(['one', 'two', 'three']) with gui.button('click me!'): def on_click(): text.value = items.value text.foreground = red </code></pre> <h3>XUL</h3> <p><a href="https://developer.mozilla.org/en/Getting_started_with_XULRunner" rel="noreferrer">XUL</a> + Javascript may be used to create stand-alone desktop apps with XULRunner as well as Mozilla extensions. Mature, open source, crossplatform.</p> <pre><code> &lt;?xml version="1.0"?&gt; &lt;?xml-stylesheet href="chrome://global/skin/" type="text/css"?&gt; &lt;window id="main" title="My App" width="300" height="300" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt; &lt;caption label="Hello World"/&gt; &lt;/window&gt; </code></pre> <p><a href="http://www.picamatic.com/show/2009/01/28/03/27/1884209_228x108.png" rel="noreferrer">XUL helloworld example http://www.picamatic.com/show/2009/01/28/03/27/1884209_228x108.png</a></p> <hr> <p>Thank your for contributions!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload