开发者

Passing user data with glade/gtkbuilder

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 gtk开发者_JAVA百科Builder treat 7 as an object reference.

So how can I just pass an int/str to the handler ?


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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜