Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am creating a 'C' project with glade and gtk. I want a focus on a gtkentry field naming txt_abc and so I called the function:

gtk_widget_grab_focus (txt_abc);

There is another gtkentry widget just after txt_abc widget naming txt_def.

My problem is instead of getting focus on txt_abc widget, the cursor is automatically being focused on txt_def widget, when I am running the application.

One more thing, when I am setting the focus at txt_def widget by calling the code:

gtk_widget_grab_focus (txt_def);

the control is again being focused on the next widget on the window, i.e. txt_name.

I want the focus exactly on the widget I am setting the grab signal.

How to resolve this problem.

share|improve this question
I suggest also asking on StackOverflow.com, as this is not Ubuntu-specific. – roadmr May 29 '12 at 15:18
I solved the same with little tweaks... – Ravi Raj May 30 '12 at 20:46

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.