tags:

views:

859

answers:

10

I learned Swing back in the day but now I've moved to Python and want to make some apps with GUIs. I haven't had the time to learn a new GUI API so I've been using Jython, but I would prefer to use CPython.

It would be great if I can have one simple markup that allows me to switch GUI libraries. It would be even better if I can use the same markup language across languages so I can quickly make GUIs for any language I'm using. Does anyone know of such a markup/library?

I've seen markups like Glade and wxWidget's markup (I forget the name). They're partly what I'm looking for (making a GUI without coding it in a language) but they're intertwined with a specific library. And neither are really nice looking or friendly to human editting.

+6  A: 

erm.. HTML? (trying to be funny here... while we wait for real answers..)

Vaibhav
Why not? If you could have a customized browser to serve it, it could be perfect choice. It's simple, standardized and easy to use.
Milan Babuškov
@Milan: until you run it on Internet Explorer...
tomlog
@Milan: Compared to other markup languages (e.g. XAML), it's enormously harder to get expected results. It may be ubiquitous, but it's neither simple nor easy.
280Z28
+1  A: 

The wxWidgets (formerly known as wxWindows) library might be what you're looking for. There's a particularly good port for Python, wxPython, as well as versions for different languages -- C#, C++, Perl and Ruby come to mind -- and for various GUIs: Win32, Mac OS X, GTK+, X11, Motif, WinCE. The library's been around for a while and is pretty solid.

Joey deVilla
+1  A: 

Not sure if this is what you're looking for, but there's Glade (or Windows download) which is a designer for GTK+. It generates an XML file which can then be used to build the GUI in a number of different languages.

Greg
+4  A: 

Qt (pronounced "cute" by its creators[1]) is a cross-platform application development framework, widely used for the development of GUI programs.

Qt uses C++ with several non-standard extensions implemented by an additional pre-processor that generates standard C++ code before compilation. Qt can also be used in several other programming languages; bindings exist for Ada (QtAda)[4], C# (Qyoto/Kimono)[5], Java (Qt Jambi)[6], Pascal, Perl, PHP (PHP-Qt), Ruby (RubyQt), and Python (PyQt). It runs on all major platforms, and has extensive internationalization support. Non-GUI features include SQL database access, XML parsing, thread management, network support and a unified cross-platform API for file handling.

CodingWithoutComments
+1  A: 

XML User Interface Language. Don't know much about it so not sure if it meets your desires. Post back with your experience if you play with it.

Anthony Cramp
A: 

I read a little on XML User Interface Language (XUL) and it looks really robust and well supported. The main problem for me is it's tied to the Gecko rendering engine so it's cross platform the way wxWidgets, QT and GTK+ are cross platform. Also, there Python bindings don't seem as good as those other libraries.

GladeXML and XRC seem like better markups

Cristian
+1  A: 

@Cristian and Antony Cramp: while XUL is a nice choice for UI development (cross-platform, open-source licensed, used in Firefox and other major software), it's certainly not language agnostic. You're tied to Gecko, with JS for scripting. There is experimental support for Python scripting, but it's only experimental, AFAIK.

You can define the UI in XUL+JS and use back-end components written in C++ though (there are Python and Java bridges available too).

Nickolay
+1  A: 

I seriously doubt you're going to find a markup language for GIU's that's not tied to a specific library. For such a thing to exist, there would need to be a standardized GUI markup language, with several implementations.

Derek Park
A: 

I would go with XSLT, therefore it could be embedded in other interfaces as well.

Andrew Sledge
A: 

I've been looking for something similar; but have not found anything satisfactory. I've drafted up a general idea of what such a thing "should" look like at the c2.com wiki, especially regarding markup communication between client and server. Search for "Gui Markup Proposal" there. Now if somebody would just make it :-)