[Gtk-sharp-list] Using ListStore.SetDefaultSortFunc
Arjen Wiersma
a.wiersma@nl.tiscali.com
Wed, 11 Feb 2004 16:31:08 +0100
--=-Iga/jzA1qRCHwB5l8KQt
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
Hi Mike,
> When people go to workarounds and don't file bugs for the stuff they
> worked around, it hard for me to know something needs fixed.
agreed.
> Please file a bug for the API you need, and if possible, provide as
> minimal a test sample as possible so I know if I've fixed it for you.
Well.. see thats actually the problem; I am pretty clueless as how to
actually use SetDefaultSortFunc;
it's defined as 'public virltual void SetDefaultSortFunc
(TreeIterCompareFunc sort_func, IntPtr user_data, DestroyNotify
destroy)' in monodoc. So my closest guess, also based on looking at the
C libs, is that it should be invoked as such:
((ListStore)this.Model).SetDefaultSortFunc(new
TreeIterCompareFunc(SerieSortFunc), this.Model, new
DestroyNotify(ConanTheDestroyer));
Where SerieSortFunc is defined as:
private int SerieSortFunc(TreeModel model,IntPtr a, IntPtr b)
and the destroy notify as such:
private void ConanTheDestroyer()
The Mono C# compiler then barks:
Exception caught by the compiler while compiling:
Block that caused the problem begin at: ./SerieTreeView.cs: (20)
Block being compiled: [./SerieTreeView.cs:
(23),Internal: (1)]
System.ArgumentNullException: null key
Parameter name: key
which in itself doesn't sound so good :)...
I am completely new to Gtk (and thus Gtk#) and also just comming around
to C# itself... so if this is a bug I will file it.. if it is just user
error... well i'll just subject myself to M-x psychoanalyze-pinhead for
an hour....
Kindest regards,
--=20
.O. Arjen Wiersma <a.wiersma@nl.tiscali.com>
..O
OOO To boldly frobnicate what no newbie has groked before!
--=-Iga/jzA1qRCHwB5l8KQt
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQBAKkq7+P3b+0wvP40RAmVRAJ95VSu5995xT+B8MbknwqaErUH0OgCgsmVG
a+/hVVlLsHKhzk1xpC2kTHM=
=Oc4G
-----END PGP SIGNATURE-----
--=-Iga/jzA1qRCHwB5l8KQt--