Fileselection error



Is there an error in the gtk+2.0 API reference.  The Fileselection dialog 
example has a callback connected like this:

 g_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (file_selector)->ok_button),
                     "clicked",
                     G_CALLBACK (store_filename),
                     NULL);

So the widget passed as the first parameter to the callback is the OK button.  
Howver, in the callback it is treated as a GTK_FILE_SELECTION thus

void store_filename (GtkFileSelection *file_selector, gpointer user_data)
{
   const gchar *selected_filename;

   selected_filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION 
(file_selector));
   g_print ("Selected filename: s\n", selected_filename);
}

Is it possible to cast a fileselection button to its parent fileselection???

Ian




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