Re: [gtk-list] gtk_get_current_event() (gtk+970606)




Hideki Fujimoto writes:
>/* key handler */
>void
>key (void)
>{
>    GdkEvent *event;
>    GdkEventKey kevent;
>    gchar ch;
>
>    gtk_get_current_event(event);
>    kevent = event->key;
>    ch = kevent.keyval;
>    g_print("input char: %c\n", ch);
>}

"gtk_get_current_event" fills in an event structure you pass it. So
the above wouldn't work because you are passing a pointer to random
memory. It should be something more like:

  GdkEvent event;
  ...
  gtk_get_current_event (&event);
  ...

Peter



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