[Gtk-sharp-list] What's the best way to display fractions in a TreeView

Slug toddglodek at hotmail.com
Fri Jul 24 18:19:43 EDT 2009


I'm really having a lot of trouble figuring out how I should go about
displaying a bunch of numeric values as fractions in a TreeView.  If I
convert them to strings and load them into the model, then the sorting is
all out of order when I click on the column header.  It looks like this
(which is wrong):
     1    1/4
     11  1/2
     2    3/4

Is there a delegate I can invoke in the TreeStore or on CellRendererText
where I can stick the code that converts the raw numeric values in the model
to the formatted strings that get displayed in the end?   Or, do I have to
create a subclass 
( e.g. CellRendererFractionText : CellRendererText )  and then override the
Render method.  This seems like a huge hassle for something so common -
especially because there are no simple examples on how to do this for just a
simple little bit of read only text.   

I must be totally missing something big and obvious  - what is it ? 

thx - Slugs

-- 
View this message in context: http://www.nabble.com/What%27s-the-best-way-to-display-fractions-in-a-TreeView-tp24652682p24652682.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.



More information about the Gtk-sharp-list mailing list