--- gdk-support.c.~1.30.~ 2003-08-05 10:32:59.000000000 +1000 +++ gdk-support.c 2003-08-05 10:38:34.000000000 +1000 @@ -548,22 +548,22 @@ } } -gchar * +/* key.string should be NULL in GDK_KEY_RELEASE and non-NULL in + GDK_KEY_PRESS, but there's no need to be concerned about that, just + return a string or #f according to what the field contains. */ +SCM gdk_event_string (GdkEvent *event) { - switch (event->any.type) - { - case GDK_KEY_PRESS: - case GDK_KEY_RELEASE: - { - gchar *str = g_malloc (event->key.length+1); - strncpy (str, event->key.string, event->key.length); - str[event->key.length] = '\0'; - return str; - } - default: - return NULL; - } + switch (event->any.type) { + case GDK_KEY_PRESS: + case GDK_KEY_RELEASE: + if (event->key.string != NULL) + return scm_mem2string (event->key.string, event->key.length); + break; + default: + break; + } + return SCM_BOOL_F; } GdkWindow *