XML GUI in Python
I'm working on a project where someone wrote a PyGTK GUI that uses docks from GDL. He has the GUI saved as an XML file:
<?xml 开发者_StackOverflow社区version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<object class="GtkUIManager" id="uimanager"/>
<object class="GtkWindow" id="mainWindow">
<property name="title" translatable="yes">Title</property>
...
The code calls
self.dock_layout.load_from_file("gui_layout.xml")
I need to remove the GDL dependency. Can I still use the XML layout? If so, how?
This seems to be a GtkBuilder file. You can use it, e.g.
builder = gtk.Builder()
builder.add_from_file("gui_layout.xml")
window = builder.get_object("mainWindow")
精彩评论