GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sun Nov 23, 2014 1:07 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: "focus" on an entry?
PostPosted: Wed Oct 26, 2011 5:27 pm 
Offline
GTK+ Geek

Joined: Sat Sep 03, 2011 6:36 pm
Posts: 94
How can i make a user "focus" on an entry when clicking a button?
what i mean is click a button and then be ready to type on the entry with the orange border around the entry


Top
 Profile  
 
 Post subject: Re: "focus" on an entry?
PostPosted: Sat Oct 29, 2011 9:21 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 777
Location: UK
There are various ways to do this, and other ways to indicate focus and the way to do this will vary from GTK 2 and GTK 3. But I would avoid trying to over ride the users theme too much. By using the colour orange a fair percentage of people (about 1% to 3% of males) can not see this colour due to colour blindness.

E.

_________________
E.


Top
 Profile  
 
 Post subject: Re: "focus" on an entry?
PostPosted: Sat Oct 29, 2011 3:58 pm 
Offline
GTK+ Geek

Joined: Sat Sep 03, 2011 6:36 pm
Posts: 94
thanks for the answer but can you show me a way to do so?


Top
 Profile  
 
 Post subject: Re: "focus" on an entry?
PostPosted: Mon Oct 31, 2011 7:49 pm 
Offline
Familiar Face

Joined: Fri Jul 01, 2011 6:40 pm
Posts: 48
Location: Croatia
If I understand well...
Under CLICKED event of your button you just add:
Code:
gtk_widget_grab_focus(your_entry_name);


Hope this helps.


Top
 Profile  
 
 Post subject: Re: "focus" on an entry?
PostPosted: Mon Oct 31, 2011 9:37 pm 
Offline
GTK+ Geek

Joined: Sat Sep 03, 2011 6:36 pm
Posts: 94
your guess was correct,thanks (:


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 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