GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Oct 23, 2014 8:41 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Unselectable text in GtkTextView
PostPosted: Sun Jun 15, 2014 12:57 pm 
Offline
Familiar Face

Joined: Thu Nov 22, 2012 3:46 pm
Posts: 22
Is there a way to make a tag in GtkTextView unselectable? So the user wont be able to select it while dragging the mouse?

Setting a GtkTextTag uneditable is easy ( there is a property for that ), but how do you make it unselectable?

I guess if there was a property in GtkTextTag that enables you to choose whether or not text can be selected, so a code line such as this would be possible:

Code:
gtk_text_buffer_create_tag (buffer, "selectable", "selectable", TRUE, NULL);


I try this but get message about "selectable" is not valid atribute for text tag.


Top
 Profile  
 
 Post subject: Re: Unselectable text in GtkTextView
PostPosted: Mon Jun 16, 2014 8:01 pm 
Offline
Familiar Face

Joined: Thu Aug 20, 2009 1:54 pm
Posts: 42
Location: Belgium
It's most probably not implemented in GtkTextView.
You can try to subclass GtkTextView (or GtkSourceView) and override some GtkWidget virtual functions to achieve what you want (see GtkWidgetClass).
To know how to override a virtual function, read the GObject documentation.
But good luck, GtkTextView is quite a complex widget (gtktextview.c is 10k lines of code, for example).


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: Google [Bot], Google Adsense [Bot] and 2 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