Declarative GTK

TL DR: Is there a library for creating a declarative user interface using GTK? Preferably with Python support.


I'm a Python / Django developer, most of my user interface experiences are a website where standard, conditionally compatible user interface designs are standard. I recently had to create a graphical application using Java / Swing for a school project and ended up using SwiXML to create declarative Swing layouts for the project.

I asked myself if there are similar features for Python. I do not really like Java, so I will not start developing Swing applications. When searching for the Python GUI Toolkits, I came to the conclusion that the three main players in this field are GTK, QT, and Wx.

Of these 3, I would prefer GTK, but I could not find a way to create a declarative interface with GTK. From my experience with HTML and SwiXML, I find creating code-based user interfaces a huge mess and would rather not do it this way. The declarative interface is much more flexible and more loosely coupled.

Is there a library for creating a declarative user interface using GTK? Preferably with Python support.

If there is no such thing (I suppose, since I could not find anything), I could start working with QT, although I do not like the look of Linux on Linux. (But maybe it's customizable too, so that it looks like a GTK.)

+5
source share
2 answers

I think what you are looking for gtk.Builder. In principle, objects gtk.Buildercan be used to load a file .uithat contains XML data that describes widgets for the user interface and callbacks to events that should be displayed by code. The file .uican be created using glade , so you don’t even need to write xml yourself.

+12

enaml. GTK , python, .

0

All Articles