Re: Reading key value from GTK_ENTRY
- From: Iago Rubio <iago rubio hispalinux es>
- To: gtk-app-devel-list gnome org
- Subject: Re: Reading key value from GTK_ENTRY
- Date: Sun, 24 Oct 2004 13:18:52 +0200
On Sun, 2004-10-24 at 10:45, RAT wrote:
How can I read special key pressed in GTK_ENTRY - eg. I need function
which clears GTK_ENRY when ENTER is pressed.
GtkWidget* entry;
.....
g_signal_connect(G_OBJECT(entry),
"key-press-event",
entry_key_press,
NULL );
gboolean
entry_key_press (GtkWidget *widget,
GdkEventKey *event,
gpointer user_data)
{
if( (event->type == GDK_KEY_PRESS) &&
(event->keyval == GDK_KP_Enter ) ){
gtk_editable_delete_text
(GTK_EDITABLE(widget), 0, -1);
return TRUE;
}
return FALSE;
}
--
Iago Rubio
- GPG Keyserv * pgp.rediris.es id=0x909BD4DD
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]