Cross Platform, Language Agnostic GUI Markup Language? [closed]

雨燕双飞 提交于 2019-12-23 06:57:13

问题


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.


回答1:


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




回答2:


http://en.wikipedia.org/wiki/Qt_(toolkit)">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.




回答3:


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.




回答4:


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.




回答5:


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.




回答6:


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.




回答7:


@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).




回答8:


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




回答9:


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




回答10:


If you switch to .NET then you can use a common GUI language, for example Razor in MVC (if you are doing web development), and have a choice of C# or VB or a number of other languages.



来源:https://stackoverflow.com/questions/5313/cross-platform-language-agnostic-gui-markup-language

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!