keypress events and DrawingArea




Hi,

I am trying to capture keypress events for DrawingArea widget, but for
some reason my keypress handler never gets called.

Is following right way to do it, or am I forgetting something?

  widget = gtk_drawing_area_new();
  gtk_widget_set_events(widget,
			GDK_EXPOSURE_MASK|
			GDK_BUTTON_PRESS_MASK|
			GDK_KEY_PRESS_MASK);

  gtk_signal_connect(GTK_OBJECT(widget), "key_press_event",
		     GTK_SIGNAL_FUNC(keypress), NULL);


 -- 
Janne Löf




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