From bcb922a3208fe00543b610a9f56ceb913771fdb2 Mon Sep 17 00:00:00 2001 From: Todd Berman Date: Sun, 16 May 2004 02:03:19 +0000 Subject: [PATCH] Fix this up so it works exactly like its C counterpart svn path=/trunk/gtk-sharp/; revision=27468 --- sample/CustomCellRenderer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sample/CustomCellRenderer.cs b/sample/CustomCellRenderer.cs index 3ceef9d51..450589941 100644 --- a/sample/CustomCellRenderer.cs +++ b/sample/CustomCellRenderer.cs @@ -43,10 +43,10 @@ public class CustomCellRenderer : CellRenderer x_offset = 0; y_offset = 0; if (!cell_area.Equals (Rectangle.Zero)) { - x_offset = (int) (this.Xalign * (this.Width - calc_width)); + x_offset = (int) (this.Xalign * (cell_area.Width - calc_width)); x_offset = Math.Max (x_offset, 0); - y_offset = (int) (this.Yalign * (this.Height - calc_height)); + y_offset = (int) (this.Yalign * (cell_area.Height - calc_height)); y_offset = Math.Max (y_offset, 0); } } @@ -102,7 +102,7 @@ public class Driver : Gtk.Window this.DeleteEvent += new DeleteEventHandler (window_delete); liststore = new ListStore (typeof (float), typeof (string)); - liststore.AppendValues (0.5f, "0.5"); + liststore.AppendValues (0.5f, "50%"); TreeView view = new TreeView (liststore); @@ -136,7 +136,7 @@ public class Driver : Gtk.Window perc -= 0.01f; liststore.SetValue (iter, 0, perc); - liststore.SetValue (iter, 1, perc.ToString ()); + liststore.SetValue (iter, 1, Convert.ToInt32 (perc * 100) + "%"); return true; }