Catch F10 on key_press_event

"drhammerit" <[email protected]>
Newsgroups gmane.comp.video.gimp.windows.devel
Message-ID <[email protected]>
Hello, 

i try with gtk-2.0.0 and gtk-2.0.6 under Win2000 SP2 to catch F10 on a
window key_press_event callbacks but nothing (under red-hat linux 7.2
gtk-2.0.0 all is ok).

Here there is a simple program (i compiling with MSVC++ 6.0):

#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <stdio.h>
#include <windows.h>



gboolean key_press_event(GtkWidget *Widget, GdkEventKey *event,
gpointer user_data)
{


  if (event->type == GDK_KEY_PRESS) 
    if (event->keyval == GDK_F10)
      printf ("F10\n");


  return FALSE;
}


#ifndef WIN32
int main(int argc, char *argv[])
#else
int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance, 
				   LPSTR lpCmdLine, int nShowCmd)
#endif
{
  GtkWidget * window;



  gtk_init(NULL,NULL);

  
  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  
  gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
		      GTK_SIGNAL_FUNC(key_press_event),
		      NULL);
		     
  gtk_widget_show(window);

  gtk_main();



  return 1;

}

Thanks 
       Dr Hammer it
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.