Thanks, that works perfectly. It's a little difficult trying to make sense of the Gtk Sharp classes, as the Documentation is often missing. I often find myself going from one "Documentation for this section has not yet been entered" to another, and then spending significant amounts of time experimenting with properties and methods, just to find out what they do. If I dind't think Mono on Linux was really important, I'd propably go back to programming .NET on Windows full time.
Regards Tracy Barlow On Wed, 2005-08-03 at 09:24 -0400, Dan Winship - [EMAIL PROTECTED] wrote: > On Wed, 2005-08-03 at 22:43 +1000, > [EMAIL PROTECTED] wrote: > > I have the following private method in a databound Control, that I am > > developing, using the GTK widgets. > > > > My problem is in the "case "System.Decimal":" section of the code. I am > > unable to find a way of setting up to pass Decimal values to the Column > > in question, so that I can later sort the Column on the numerical > > values. > > Right. The problem is that the sorting is happening in the underlying C > code, but there's no C type that corresponds to System.Decimal, so if > you put decimal values into the column, what actually gets stored is not > the value itself, but just a pointer to a copy of it. > > You ought to be able to work around this by specifying a custom sort > function for that column, with the ListStore's SetSortFunc() method. (If > you're using gtk# 1.0, you need to make sure that the delegate you pass > for sort_func doesn't get GC'ed. If you're using gtk# 2.3/2.5, then gtk# > handles that for you automatically.) When you call store.GetValue() from > the TreeIterCompareFunc, the decimal values will be unwrapped > automatically, and you can compare them as decimals and return the right > comparison value. > > -- Dan > > > _______________________________________________ > Gtk-sharp-list maillist - [email protected] > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > _______________________________________________ Gtk-sharp-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
