/* Private methods */ public void DrawMargin (TextView textView) { /* Get char count info */ int[,] info; GetCharCountDrawInfo(textView, out info); /* Set margin and window */ int marginWidth = (this.marginSpace * 2) + (this.marginDigitCount * this.marginCharWidth); textView.SetBorderWindowSize(TextWindowType.Right, marginWidth); Gdk.Window window = textView.GetWindow(TextWindowType.Right); window.Clear(); /* Draw line */ window.DrawLine(this.lineGC, 0, 0, 0, textView.Allocation.Height); /* Draw text */ int infoCount = info.GetLength(0); for (int i = 0 ; i < infoCount ; i++) { int charCount = info[i, 0]; int y = info[i, 1]; this.textLayout.SetText(charCount.ToString()); int textLayoutWidth, textLayoutHeight; this.textLayout.GetPixelSize(out textLayoutWidth, out textLayoutHeight); window.DrawLayout(this.textGC, this.marginSpace, y - textLayoutHeight/2, this.textLayout); } }