Very simple, concise and easy GUI framework programming

Please list the GUI programming libraries, toolkits, frameworks that allow you to quickly write graphical applications. I mean in a way that

  • The GUI is described completely in a text file (code) that is readable by humans (and for humans)
  • the code is short (1 or 2 lines of code per widget / event pair), suitable for scripts
  • The structure and operation of the graphical interface is obvious from the code (embedding widgets and the flow of events)
  • information on how to create a graphical interface is hidden (for example, mainloop, adding event listeners, etc.).
  • supported automatic layouts (vbox, hbox, etc.).

As the answers show, this can be defined as declarative GUI programming, but this is not necessarily the case. Any approach is fine, if it works, easy to use and concise.

There are some GUI libraries / tools like this. They are listed below. Please distribute this list if qualified tools are not available. Indicate if the project is cross-platform, mature, active and give an example, if possible.

Please use this wiki to discuss only open source projects.

This is the list so far (in alphabetical order):

Fudgets

Fudgets is the Haskell library. Platform: Unix. Status: experimental, but still supported. Example:

import Fudgets main = fudlogue (shellF "Hello" (labelF "Hello, world!" >+< quitButtonF)) 

Example screenshots of Fudgets http://www.picamatic.com/show/2009/01/28/02/40/1883597_93x80.gif

GNUstep Renaissance

Renaissance allows you to describe a GUI in plain XML. Platforms: OSX / GNUstep. Status: part of GNUstep. Example below:

 <window title="Example"> <vbox> <label font="big"> Click the button below to quit the application </label> <button title="Quit" action="terminate:"/> </vbox> </window> 

Renaissance screenshot example http://www.picamatic.com/show/2009/01/28/03/19/1884098_289x80.png

HTML

HTML-oriented graphical interface (HTML + JS). Cross-platform, mature. It can be used completely on the client side.

We are looking for a good example of "helloworld".

HTML GUI Example http://www.picamatic.com/show/2009/01/28/02/44/1883635_264x60.png

Javafx

JavaFX can be used for standalone (desktop) applications, as well as for web applications. Not fully cross-platform, not yet fully open source. Status: Release 1.0. Example:

  Frame { content: Button { text: "Press Me" action: operation() { System.out.println("You pressed me"); } } visible: true } 

A screenshot is required.

Phooey

Phooey is another Haskell library. Crossplatform (wxWidgets), HTML + JS plan planned. Mature and active. Example (slightly larger than helloworld):

  ui1 :: UI () ui1 = title "Shopping List" $ do a <- title "apples" $ islider (0,10) 3 b <- title "bananas" $ islider (0,10) 7 title "total" $ showDisplay (liftA2 (+) ab) 

Phooey screenshot example http://www.picamatic.com/show/2009/01/28/02/33/1883543_236x187.png

Pythoncard

PythonCard describes a graphical interface in the Python dictionary. Cross-platform (wxWidgets). Some applications use it, but the project seems to be inhibited. There is an active plug.

I skipped the PythonCard example because it is too detailed for the contest.

PythonCard screenshot example http://www.picamatic.com/show/2009/01/28/02/46/1883646_199x99.gif

Footwear

Shoes for Ruby. Platforms: Win / OSX / GTK +. Status: Young but active. The minimum application is as follows:

  Shoes.app { @push = button "Push me" @note = para "Nothing pushed so far" @push.click { @note.replace "Aha! Click!" } } 

Example screenshots for shoes http://www.picamatic.com/show/2009/01/28/03/14/1884011_227x71.png

Tcl / tk

Tcl / Tk . Crossplatform (own widget set). Mature (possibly even dated) and active. Example:

  #!/usr/bin/env wish button .hello -text "Hello, World!" -command { exit } pack .hello tkwait window . 

Tcl / Tk screenshot example http://www.picamatic.com/show/2009/01/28/02/51/1883672_111x58.png

tekUI

tekUI for Lua (and C). Platforms: X11, DirectFB. Status: Alpha (in use, but the API is still evolving). Example:

  #/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() 

tekUI helloworld screenshot http://www.picamatic.com/show/2009/01/28/03/01/1883821_290x55.png

Treethon

Treethon for Python. It describes the GUI in the YAML file (Python in the YAML tree). Platform: GTK +. Status: work in proress. A simple application is as follows:

  _import: gtk view: gtk.Window() add: - view: gtk.Button('Hello World') on clicked: print view.get_label() 

Screenshot of Treethon helloworld http://treethon.googlecode.com/svn/trunk/treethon_gtk_tutorial/base.png

Still unnamed Python library by Richard Jones:

This one has not been released yet. The idea is to use Python contextual managers ( with keyword) to structure your GUI code. See the Richard Jones blog for more details.

 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 

Xul

XUL + Javascript can be used to create standalone desktop applications with XULRunner and Mozilla extensions. Mature, open source, cross-platform.

  <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="main" title="My App" width="300" height="300" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <caption label="Hello World"/> </window> 

XUL example helloworld http://www.picamatic.com/show/2009/01/28/03/27/1884209_228x108.png




Thanks for the contribution!

+58
user-interface scripting open-source declarative
Jan 22 '09 at 19:24
source share
10 answers

Not for a child, but for HTML.

It is cross-platform and summarizes gui-layout in a simple text file. He is definitely mature as well as well understood and well documented.

There are several ways to template HTML files for dynamic content, and other ways to convert custom syntaxes to HTML if you don't like angle brackets.

Client scripts with Javascript, server scripts with PHP / Ruby / Python / Perl.

It is not very suitable for all purposes, but for many it is good enough. There is no reason why it should be serviced: you can distribute the HTML file to your clients if you want - see TiddlyWiki for a good example of where this might go.

+16
Jan 22 '09 at 20:34
source share

What you describe is, with the exception of shoes, a newfangled concept of declarative programming. I would describe shoes more as a Domain-Specifc Language GUI . Well, I say that the new forms: Visual Basic forms, if you looked at the IDE designer, were declarative. So, even further, there were Oracle SQL * Forms, although assembling them using a text editor was a process that only the most daring should carry out.

To add another list to the list, Microsoft XAML , which, among other things, describes the graphical interfaces built for WPF .

Although some of the schemes mentioned are quite simple, declaratively defined graphical interfaces can be as complex as anything defined in the code, they are simply simpler and more complex: they say "what" you want, and leave it in the framework for processing "as "

+7
Jan 22 '09 at 21:10
source share

TCL / TK is a script language used to create a graphical interface interactively. It is available on a variety of platforms, including Unix, Windows, and Mac OS X.

+6
Jan 22 '09 at 21:21
source share

Pajamas - http://pyjs.org - it is a set of desktop widgets disguised as AJAX-based Web 2.0 widgets. it really does NOT like the set of web widget that I actually ported to the desktop - http://pyjd.org - using webkit (the same engine in adobe AIR, google chrome, safari, etc.)

this is "hello world":

 from pajamas.ui.RootPanel import RootPanel
 from pajamas.ui.Button import Button
 from pajamas import Window

 def greet (fred):
     Window.alert ("Hello, AJAX!")

 if __name__ == '__main__':
     b = Button ("Click me", greet)
     RootPanel (). Add (b)

which immediately answers the first four of five requirements. requirement 5 is satisfied as follows:

 from pajamas.ui.RootPanel import RootPanel
 from pajamas.ui.HorizontalPanel import HorizontalPanel
 from pajamas.ui.HTML import HTML

 p = HorizontalPanel ()
 p.add (HTML ("<b> Hello </b>"))
 p.add (HTML ("World"))
 RootPanel (). Add (p)

it could not be easier.

+3
Apr 08 '09 at 17:30
source share

XUL (it is quite easy to use and powerful - most of Firefox is implemented using XUL for GUI structure, + javascript for logical processing)

The XUL tutorial contains some good examples. Here is one for tabboxes . There are switchable tabs, buttons, edit fields and group fields at the bottom of the page, and it's pretty simple (without Javascript / CSS / XBL / key / etc bindings). Then they gradually add more material , which represents a lot of functionality for the length of the file that indicates it. (at least until you start adding javascript to handle the logic in question). If I had to do something like this in Win32, that would be a real pain.

+2
Jan 22 '09 at 20:56
source share

wxLua is the shell of the wxWidgets library for Lua. It uses the Connect method to bind the events of the gui widget to functions (functions are first-class, as in JS).

+2
Jan 26 '09 at 17:14
source share

The GTK-server is extremely easy to use and can be used with over 30 languages, including Bash and Visual Basic.

+2
Mar 17 '09 at 14:42
source share

SDL / Swing is extremely simple, readable, unobtrusive (283k lib without dependencies) and easy to use. Example:

 menus { "File" { "Open" do="open" // calls "open()" in the controller "---" "Exit" do="exit" } } 

Its open source, but enjoys commercial support from Ikayzo.com. Ports for .NET and iOS continue.

+2
Jun 08 '10 at 13:37
source share

Today I met SDL / Swing .

+1
May 26 '10 at 4:25
source share

You should take a look at XAML if you are on the .NET platform.

-2
Jan 26 '09 at 19:27
source share



All Articles