GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Dec 19, 2014 6:15 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: [SOLVED] How to check if a text is selected on an entry?
PostPosted: Tue Apr 12, 2011 2:48 am 
Offline

Joined: Tue Apr 12, 2011 2:38 am
Posts: 2
Hi people, I want to check if a content of an entry is selected. My function will run only if it is a selected text in an entry.

When the user activate de Edit menu, some function will check if exist a selected text, and then return TRUE or FALSE. The only problem is, how to check if a text is selected on an entry?

Thanks.


Last edited by Mako on Thu Apr 14, 2011 12:55 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: How to check if a text is selected on an entry?
PostPosted: Wed Apr 13, 2011 4:27 am 
Offline
Familiar Face

Joined: Mon Dec 21, 2009 7:32 pm
Posts: 6
What aboyt the "selection-bound" property?

if that property returns 0 it means that no selection is made.


Top
 Profile  
 
 Post subject: Re: How to check if a text is selected on an entry?
PostPosted: Thu Apr 14, 2011 12:51 am 
Offline

Joined: Tue Apr 12, 2011 2:38 am
Posts: 2
gatuno_123 wrote:
What aboyt the "selection-bound" property?

if that property returns 0 it means that no selection is made.

Thanks for help.

I use the function gtk_editable_get_selection_bounds().

Code:
      if (gtk_editable_get_selection_bounds  (GTK_EDITABLE (entry), NULL, NULL))
         {
            gtk_widget_set_sensitive (GTK_WIDGET (cut), TRUE);
         }
         else
         {
            gtk_widget_set_sensitive (GTK_WIDGET (cut), FALSE);
         }


That's working now.


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot], Google Adsense [Bot] and 3 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