Thanks a lot for your reply Keith. 

 

As you said, I should use gtk_combo_box instead of gtk_combo. 

But the problem remains the same with gtk_combo_box, the 
gtk_widget_grab_focus() is not working on it.

Do you have any idea for this behavior?

 

Thanks,

Anmol

Keith Maika <[EMAIL PROTECTED]> wrote: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.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to