Re: Focus behaviour on widget derived from a gtkentry



On 7 December 2011 09:16, Geert Janssens <info kobaltwit be> wrote:
I am now having problems to set the focus on this widget programmatically. In
this particular use case, the widget is added to a GtkAssistant, and during
the prepare of the page showing this widget, I call a gtk_widget_grab_focus on
it. This does nothing.

I remember struggling to get focus working in my widgets too. In my
case the problem turned out to be forgetting to set the CAN_FOCUS flag
in _init(). Have you tried this?

  http://developer.gnome.org/gtk/2.24/GtkWidget.html#gtk-widget-set-can-focus

Needs to be called at some point for every widget object that can take
focus. Though perhaps the parent class should do this for you? Maybe
worth a try anyway.

John



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