[Gtk-sharp-list] Help, textview

Darwin Reynoso monouser at gmail.com
Mon Feb 11 17:23:08 EST 2008


thanks a lot Chris and Anthony it worked.


On Mon, Feb 11, 2008 at 4:17 PM, anthony taranto
<anthony.taranto at medsphere.com> wrote:
> the SelectLine method provided won't select anything if the line
>  parameter is the last line of the buffer. to handle that case you'd want
>  something like this:
>
>
>  private void SelectLine (TextView view, int line) {
>         TextBuffer buffer = view.Buffer;
>
>         TextIter start, end;
>         start = end = buffer.GetIterAtLine (line);
>         end.LineOffset = start.CharsInLine;
>
>         buffer.SelectRange (start, end);
>  }
>
>  --anthony
>
>
>
>  On Mon, 2008-02-11 at 11:10 -0500, Chris Howie wrote:
>  > On Feb 8, 2008 9:04 AM, Darwin Reynoso <monouser at gmail.com> wrote:
>  > > Hi,
>  > > how do i select a line in a textview.
>  >
>  > private void SelectLine(TextView view, int line) {
>  >         TextBuffer buffer = view.Buffer;
>  >
>  >         TextIter start = buffer.GetIterAtLine(line);
>  >         TextIter end = buffer.GetIterAtLine(line + 1);
>  >
>  >         buffer.SelectRange(start, end);
>  > }
>  >
>  > P.S. Documentation is a wonderful thing.
>  >
>
>


More information about the Gtk-sharp-list mailing list