Re: gtkentry grab-focus
- From: "control H" <control h gmail com>
- To: gtk-app-devel <gtk-app-devel-list gnome org>
- Subject: Re: gtkentry grab-focus
- Date: Mon, 4 Dec 2006 21:56:26 +0100
For those interested, here's a way to get the desired result. The
source of gtkentry.c shows that if the entry receives a click, it
resets the selection to the current position of the cursor. Hence the
following button-press-event callback works:
static gboolean event_cb(GtkWidget*w,GdkEvent*event,gpointer p)
{
if(!GTK_WIDGET_HAS_FOCUS(w)){
gtk_widget_grab_focus(w);
return TRUE;
}
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]