Re: Combobox Focus Challenge!!!



anmol dhawan wrote:
Hi,

In the following attached code,  gtk_widget_grab_focus() is not able to shift  the focus to combobox.

The behavior should be:
When button1 is clicked, focus should come to button and when button is clicked focus should come to combobox.

But the focus is not coming on the combobox.

Why the focus is not coming on the combobox and which api should I use for this?


According to the docs, you supposed to use GtkComboBox now, and not
GtkCombo.  I don't know if that would have an effect as you have the
code now or not, as I haven't used it.  For a GtkCombo though, you have
to set the focus on the entry widget that is contained inside the combo
struct.  So, you want code like this:

gtk_widget_grab_focus(GTK_COMBO(combo)->entry);

--
Keith Maika
http://kicken.mine.nu:8008/  - Personal Site.
http://wiser.kicks-ass.org:8008/  - Long-term Project.
http://www.gnu.org/philosophy/can-you-trust.html - Can you trust your
computer?
http://www.gnu.org/philosophy/no-word-attachments.html - Support Open
Communication.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]