Bug 8447 - TreeModelDemo sample (TreeModelImplementor) does not work
Summary: TreeModelDemo sample (TreeModelImplementor) does not work
Status: RESOLVED FIXED
Alias: None
Product: Gtk#
Classification: Mono
Component: gtk-sharp ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-11-15 20:43 UTC by Curtis Wensley
Modified: 2012-11-17 12:13 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Curtis Wensley 2012-11-15 20:43:02 UTC
The TreeModelDemo.cs sample does not work with gtk-sharp 3.0.

This was tested on Ubuntu 12.10.

It throws an exception:

Unhandled Exception: System.ArgumentException: GCHandle value belongs to a different domain
  at System.Runtime.InteropServices.GCHandle.op_Explicit (IntPtr value) [0x00000] in <filename unknown>:0 
  at Gtk.TreeModelAdapter.Initialize (IntPtr ptr, IntPtr data) [0x00000] in <filename unknown>:0 
  at (wrapper native-to-managed) Gtk.TreeModelAdapter:Initialize (intptr,intptr)
  at (wrapper managed-to-native) GLib.Object:g_type_add_interface_static (intptr,intptr,GLib.GInterfaceInfo&)
  at GLib.Object.AddInterfaces (GType gtype, System.Type t, System.Boolean& handlers_overridden) [0x00000] in <filename unknown>:0 
  at GLib.Object.RegisterGType (System.Type t) [0x00000] in <filename unknown>:0 
  at GLib.GType.LookupGObjectType (System.Type t) [0x00000] in <filename unknown>:0 
  at GLib.Object.LookupGType (System.Type t) [0x00000] in <filename unknown>:0 
  at GLib.Object.LookupGType () [0x00000] in <filename unknown>:0 
  at GLib.Object.CreateNativeObject (System.String[] names, GLib.Value[] vals) [0x00000] in <filename unknown>:0 
  at GLib.Object..ctor () [0x00000] in <filename unknown>:0 
  at GtkSamples.MyTreeModel..ctor () [0x00000] in <filename unknown>:0 
  at GtkSamples.TreeModelDemo..ctor () [0x00000] in <filename unknown>:0 
  at GtkSamples.TreeModelDemo.Main (System.String[] args) [0x00000] in <filename unknown>:0
Comment 1 Bertrand Lorentz 2012-11-17 11:58:34 UTC
Thank you for the bug report.

I've just committed a fix for it to git master:
https://github.com/mono/gtk-sharp/commit/306f422c3

I've also fixed the TreeModelDemo, which would also crash later on when opening a node:
https://github.com/mono/gtk-sharp/commit/de6b6029e

If the fix works for you, please mark this bug as resolved (I can't do it myself).
Comment 2 Curtis Wensley 2012-11-17 12:13:04 UTC
Works beautifully!  Thanks!