使用glade/gtkbuilder传递用户数据
我是glade/pygtk的新手。
我正在处理一些无线电菜单项。 我在信号选项卡上创建了一个信号处理程序,
处理程序:on_group_menu_change
user data: 7
我期望的是将 int(或 str)值 7 作为用户参数传递给处理程序。然而,在启动时,我发现这样的警告:
无法在信号上查找对象 0 对象radiomenuitem1的group_changed
我知道 gtkBuilder 将 7 视为对象引用。
那么我怎样才能将 int/str 传递给处理程序呢?
I am a newbie of glade/pygtk.
I am doing with some radio menu items.
I created a signal handler on the signals tab,
handler: on_group_menu_change
user data: 7
what I expected is pass the int(or str) value 7 as user param to the handler. However, at startup, I found such warning:
Could not lookup object 0 on signal
group_changed of object radiomenuitem1
I know gtkBuilder treat 7 as an object reference.
So how can I just pass an int/str to the handler ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来这仍然在 Glade/GtkBuilder 待办事项列表中:http://live.gnome。 org/Glade/Roadmap/RealUsableSignals
目前,您只能传递对您在 xml 中定义的对象的引用。
编辑:自 gtk+3 以来,开发人员不仅仅破坏了 API...上面的存档链接是:
https://web.archive。 org/web/20100510072526/http://live.gnome.org/Glade/Roadmap/RealUsableSignals
It seems this is still on the Glade/GtkBuilder todo-list: http://live.gnome.org/Glade/Roadmap/RealUsableSignals
Currently you can only pass references to objects that you define in your xml.
Edit: Since gtk+3, the devs have broken more than just the API... The archived link above is:
https://web.archive.org/web/20100510072526/http://live.gnome.org/Glade/Roadmap/RealUsableSignals