开发者

XML GUI in Python

开发者 https://www.devze.com 2023-01-08 20:03 出处:网络
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:

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")
0

精彩评论

暂无评论...
验证码 换一张
取 消