In python, I could just do builder.connect_signals(self)
. It doesn't seem like this method exists in C#, and after looking at the GtkBuilder documentation, it looks like python is the exception, rather than the rule. How would I accomplish the same thing in C#?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Right now Gtk.Builder is not fully implemented in the current version of Gtk# (2.12). This thread explains the current situation. So once Gtk# 2.14 is released, you can just do:
In the meantime you could use Glade.XML, and then convert your code (and glade files) as described here: http://lists.ximian.com/pipermail/gtk-sharp-list/2008-October/009157.html
You can connect your signals using method
Autoconnect
, but method that represent a signal in c# must be in form:So each field of class that you use in such method must be declared as
static
. It robs you of creating another instance of your class.There is another way of connecting signals: