Event_box problem



Hi i have a problem with event_box widget....
I create a event_vox and put into a label, set the event_box to
GDK_ALL_EVENTS and then connect the signal button_press_event.
Well I want to display the text of the gpointer when the user press the
label but it doesn´t work.

What I´m doing wrong?

This is the code:

 event_box = gtk_event_box_new();
 gtk_container_add(GTK_CONTAINER(window),event_box);
 gtk_widget_set_events (event_box, GDK_ALL_EVENTS_MASK);
 gtk_signal_connect (GTK_OBJECT(evento), "button_press_event",
      GTK_SIGNAL_FUNC(show), (gpointer)"Label Pressed");

 label = gtk_label_new("PRESS");
 gtk_container_add(GTK_CONTAINER(event_box),label);


and this is the callback function:

void show (GtkWidget* widget, gpointer *datos){
     printf("%s\n",(char*)datos);
}

Thanks for all.
Victor Cuervo



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