在Python中,我可以这样做builder.connect_signals(self)
。 C#中好像不存在这个方法,看了之后GtkBuilder 文档 http://library.gnome.org/devel/gtkmm/unstable/classGtk_1_1Builder.html,看起来 python 是例外,而不是规则。我如何在 C# 中完成同样的事情?
目前,Gtk.Builder 在当前版本的 Gtk# (2.12) 中尚未完全实现。
这thread http://go-mono.com/forums/#nabble-td23463336解释了目前的情况。因此,一旦 Gtk# 2.14 发布,您可以执行以下操作:
builder.Autoconnect (this);
同时你可以使用Glade.XML http://www.go-mono.com/docs/index.aspx?tlink=24@ecma:372%23XML/,然后按照此处所述转换您的代码(和空地文件):http://lists.ximian.com/pipermail/gtk-sharp-list/2008-October/009157.html http://lists.ximian.com/pipermail/gtk-sharp-list/2008-October/009157.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)