I have the following code to get a filename with a file
selection tool, but it gives my the X window error shown below. Any ideas
what might cause this and how I can fix it?
void WorkspaceManip::saveRawData(GtkWidget *link,
WorkspaceManipData *myData)
{ // Create the file selector myData->fileSelector = gtk_file_selection_new ("Save Raw Data");
g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION
(myData->fileSelector)->ok_button), "clicked", G_CALLBACK(rawDataFilename), myData); g_signal_connect_swapped
(GTK_OBJECT
(GTK_FILE_SELECTION (myData->fileSelector)->cancel_button), "clicked", G_CALLBACK (gtk_widget_destroy), (gpointer) myData->fileSelector); // Display that dialog
gtk_widget_show (myData->fileSelector); } void WorkspaceManip::rawDataFilename(GtkWidget *w, WorkspaceManipData *myData) { gchar *selected_filename =(gchar *) gtk_file_selection_get_filename (GTK_FILE_SELECTION(myData->fileSelector)); gtk_widget_destroy(myData->fileSelector); } The program '<unknown>' received an X Window System
error.
This probably reflects a bug in the program. The error was 'BadDrawable (invalid Pixmap or Window parameter)'. (Details: serial 13370 error_code 9 request_code 55 minor_code 0) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.) |