[Gtk-sharp-list] [PATCH] Fix custom CellRenderer creation
christian_hoff at gmx.net
Fri Oct 23 10:22:47 EDT 2009
Diego Elio “Flameeyes” Pettenò wrote:
> While I was working on creating a custom cell renderer for a project of
> mine, I found that once I tried to override the Render method, and
> simply call the base one, the program would crash with an error in the
> native code.
> The attached patch makes custom CellRenderer behave, although it might
> be a bit hackish: the other functions that use "ref Gtk.Rectangle" for
> the native call also have it in the managed interface, but since I
> didn't want to change the interface (which I'm pretty sure would be a
> bad thing™) I kept the ref only in the subsequent call. It *should* be
> fine since the rectangles shouldn't be modified as far as I can see.
I went ahead and committed the patch to the 2.12 branch (the code in
trunk/2.90 is correct). Thank you very much for the fix and the test case.
> I also have another problem here: how do I make sure the Windows gtk#
> also have this applied? Should I rebuild it myself, or using the .dll
> file built on (Gentoo) Linux with that patch should be enough?
You can use the Linux dll if you fix the calling convention by using the
gapi-cdecl-insert script in the Gtk# 2.12 repo (or just wait for 2.12.10).
More information about the Gtk-sharp-list