key press events



HI all
I've this piece of code : 
  gtk_widget_add_events (GTK_WIDGET (MyWindow->image), GDK_BUTTON_PRESS_MASK);
  gtk_signal_connect (GTK_OBJECT (MyWindow->image), "button_press_event",  
GTK_SIGNAL_FUNC (MosMenu), GTK_OBJECT (file_menu));  
  
  gtk_widget_add_events (GTK_WIDGET (MyWindow->image), GDK_KEY_PRESS_MASK);
  gtk_signal_connect (GTK_OBJECT (MyWindow->image), "key_press_event",  
GTK_SIGNAL_FUNC (LastKeyPressed), NULL);  

(MyWindow->image is a rgb_image)

for the mouse event, there's no problem, my callback is called.
But the key_press_event does not work. 

Is it preferable to add 2 event masks  in one gtk_widget_add_event, or 2 
add_event, like this ? 

thanks




-- 
Jean-Yves Lamoureux
Software Developper



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