GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Mon Nov 24, 2014 6:02 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Newly inserted TextBuffer text becomes selected.
PostPosted: Wed Feb 19, 2014 5:47 pm 
Offline

Joined: Wed Feb 19, 2014 12:30 am
Posts: 2
Hi, I noticed that in GTK2 at least, if you insert text at the point where the cursor is, and there's text in the TextBuffer at that point, the newly inserted text also becomes selected. For example, if the contents are like this before (blue text represents selected text, | represents cursor position)

Foo bar, foobar| foob ar fo oobar?

Then if you do for example gtk_text_buffer_insert_at_cursor or _at_offset and insert anything, let's say "new text", it'll look like this:

Foo bar, foobarnew text| foob ar fo oobar?

I'd like it to not be selected and instead look like this though:

Foo bar, foobar|new text foob ar fo oobar?

How do I do that?


Top
 Profile  
 
 Post subject: Re: Newly inserted TextBuffer text becomes selected.
PostPosted: Wed Feb 19, 2014 10:56 pm 
Offline

Joined: Wed Feb 19, 2014 12:30 am
Posts: 2
I was able to work around this issue by using GtkTextMarks and manually adjusting the selection start/end points after the text was inserted.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group