Re: How do you programatically set the selected range in a GtkTextView?



Nicholas Allen - Sun Ireland - Software Engineer <nicholas allen ireland sun com> writes:

 I am wondering: how does one programatically set the selection for
a text view to a range of characters?


Move the "insert" or "selection_bound" mark.

I find it strange that the GtkTextBuffer manages the currently
selected range and not the GtkTextView. The selection is much more a
visual thing and should be associated with the view not the buffer
surely. What's the point of being able to have multiple text views if
they have to have the same selected text?

It's essentially an accident, the text widget is a port of TkText and
it worked this way, and no one noticed the issue in time to change it.

There are workarounds though, see
http://bugzilla.gnome.org/show_bug.cgi?id=57050

Havoc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]