Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Very simple, terse and easy GUI programming “frameworks” [closed]

People also ask

Why does C++ have GUI?

Standard C++ includes "console" output. It does not include any facilities for GUI. There are various reasons for this - most notably, that a lot of devices targeted by C++ developers don't have a screen, let alone a need for GUI.

Is GUI easy to learn?

Unlike a command-line operating system or CUI, like Unix or MS-DOS, GUI operating systems are easier to learn and use because commands do not need to be memorized. Additionally, users do not need to know any programming languages.

How do I start a programming GUI?

To create a custom GUI program you basically do five things: Create instances of the widgets you want in your interface. Define the layout of the widgets (i.e., the location and size of each widget). Create functions that will perform your desired actions on user generated events.


Not to kid, but HTML.

It's cross-platform, and sums up the gui-layout in a simple textfile. It's definitely mature, as well as well-understood and well documented.

There's a bunch of ways to template HTML files for dynamic content, and other ways to convert custom syntaxes to HTML if you dislike angle-brackets.

Client-side scripting w/ Javascript, server-side scripting with PHP/Ruby/Python/Perl.

It's not well suited for all purposes, but for many, it's good enough. There's no reason that it has to be served either - you can distribute a HTML file to your clients if you want - see TiddlyWiki for a good example of where that can go.


What you're describing is, with the exception of shoes, the new-fangled notion of declarative programming. I'd describe shoes more as a GUI Domain-Specifc Language. Well, I say new-fangled: Visual Basic forms, if you looked behind the IDE designer, were declarative. So, going further back still, were Oracle's SQL*Forms, although assembling them with a text editor was a process only to be be undertaken by the very bravest.

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

Although some of the schemes mentioned are fairly simple, declaratively-defined GUIs can be as complex as anything defined in code, they're just easier and terser: they say "what" you want to happen and leave it to the underlying framework to handle the "how".


TCL/TK is a script language used for building GUI interactively. It is available on various platforms including Unix, Windows and Mac OS X.


Pyjamas - http://pyjs.org - it's a desktop widget set, disguised as an AJAX-based web 2.0 widget set. it's so very much NOT like a web widget set that i actually ported it to the desktop - http://pyjd.org - using webkit (the same engine in adobe AIR, google chrome, safari etc.)

this is "hello world":

from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.Button import Button
from pyjamas import Window

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

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

that immediately answers the first four out of five requirements. requirement 5 is fulfilled by this:

from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.HorizontalPanel import HorizontalPanel
from pyjamas.ui.HTML import HTML

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

it couldn't get any simpler.


XUL (it's pretty easy to use, and powerful -- much of Firefox is implemented using XUL for GUI structure, + javascript for logic handling)

The XUL tutorial has some good examples. Here's one for tabboxes. The one at the bottom of the page has switchable tabs, buttons, edit boxes, and group boxes, and it's fairly simple (no Javascript/CSS/XBL/key bindings/etc). They then add progressively more stuff later which is a lot of functionality for the length of the file that specifies it. (at least until you start adding javascript to handle the logic in question) If I had to do something like this in Win32 it would be a real pain.


wxLua is a wrapper of the wxWidgets library for Lua. It uses a Connect method to attach gui widget events to functions (functions are first class like in JS).


GTK-server is extremely simple to use and can be used from more than 30 languages, including Bash and Visual Basic.