I think I have some fundamental misunderstanding with how callbacks work. The following code crashes whenever the callback is called, mostly because I'm not exactly sure how to do what I'm trying to do.
I want to pass the GtkEntry text object to the callback function, but as I said, the application crashes when it gets to this point. If someone could give me an idea of what I'm doing wrong, I'd very much appreciate it.
I understand that this may or may not be how you'd go about this in reality, but I'm just experimenting. What I'm ultimately trying to do is simply read in the contents of the text field on either the button press or the enter key being pressed.
main( int argc, char **argv )
gtk_init( &argc, &argv );
dialog = gtk_dialog_new_with_buttons( "Name Entry",
text = gtk_entry_new( );
gtk_container_add( GTK_CONTAINER( GTK_DIALOG( dialog )->vbox ), text );
gtk_widget_show_all( dialog );
text_callback( GtkWidget* w, gpointer data )
printf( "%s\n", gtk_entry_get_text( x ));