Use glade with pygobject Gtk3

风流意气都作罢 提交于 2019-12-03 05:49:13

Well, the solution is pretty obvious, after calling to Gtk.Builder() one needs to convert the old glade interface with the gtk-builder-convert command to get the interface file in the right version.

 $ gtk-builder-convert myui.glade myui.ui

And then, in the python script:

 from gi.repository import Gtk
 builder = Gtk.Builder()
 builder.add_from_file("myui.ui")

Thanks to Riccardo.

This should work

from gi.repository import Gtk
builder = Gtk.Builder()
builder.add_from_file("project.xml")
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!