How to use and process GTK enter or leave signals?



Just for testing I used a GtkButton and substituted signal enter-notify-event for signal clicked (clicked works).  A warning appears: "enter-notify-event is invalid for instance" after g_signal_connect is executed. The callback handler is not called.
Simplified:

[code]
GtkWidget * b = gtk_new_button ();
....
g_signal_connect (b, "enter-notify-event",
                  G_CALLBACK (enterleave), myuserdata) ;
...
[/code]

with callback handler

[code]
static gboolean enterleave ( GtkWidget * w,
                             GdkEventCrossing * event,
                             char * data )
   {
  printf ( "Now in enterleave callback\n" ) ;
   ....
   return false;
   }
[/code]


I also tried:
[code]
gtk_widget_set_events ( b, _ENTER_NOTIFY_MASK );
g_signal_connect (b , "enter-notify-event",
                   G_CALLBACK (enterleave), myuserdata) ;
[/code]

and also signal "enter" (deprecated), but result was same.

Cannot see what is wrong, so help would be most appreciated.




Get your new Email address!
Grab the Email name you've always wanted before someone else does!

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