为什么 python 2.7.2 pygtk 解析空地 GtkButtonBox 会出现段错误?
以下是重现我的问题的步骤:我在glade 3.10.0中设计了一个UI,包括一个包含4个按钮的GtkButtonBox:
<object class="GtkButtonBox" id="i_bbox">
<property name="visible">True</property>
[...] some children (buttons)
glade文件被加载到python脚本中:
builder_fname = "example_layout.glade"
self.root = gtk.Builder()
self.root.add_from_file(builder_fname)
self.root.connect_signals(self)
当脚本执行时,它会出现以下回溯错误:
./example.py:37: Warning: cannot create instance of abstract (non-instantiatable) type `GtkButtonBox'
self.root.add_from_file(builder_fname)
[1] 5088 segmentation fault (core dumped) ./example.py
有人吗知道如何解决这个问题吗?我正在使用 pygtk 2.24.0
Here are the steps to reproduce my problem: I designed a UI in glade 3.10.0 including a GtkButtonBox containing 4 buttons:
<object class="GtkButtonBox" id="i_bbox">
<property name="visible">True</property>
[...] some children (buttons)
The glade file gets loaded into the python script:
builder_fname = "example_layout.glade"
self.root = gtk.Builder()
self.root.add_from_file(builder_fname)
self.root.connect_signals(self)
When the script gets executed, it segfaults with the following traceback:
./example.py:37: Warning: cannot create instance of abstract (non-instantiatable) type `GtkButtonBox'
self.root.add_from_file(builder_fname)
[1] 5088 segmentation fault (core dumped) ./example.py
Does someone have an idea how to fix this? I'm using pygtk 2.24.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该警告似乎暗示您需要使用 GtkHButtonBox 或 GtkVButtonBox 与 GtkButtonBox ...这些会出现段错误吗?
The warning seems to hint that you need to use GtkHButtonBox or GtkVButtonBox versus GtkButtonBox ... do those segfault?