gtk_entry_append problem



Heres a sample of my program.


char *store_filename(GtkFileSelection *file_selection, gpointer data)
{
  filename =
gtk_file_selection_get_filename(GTK_FILE_SELECTION(file_selection_box));
  g_print ("%s\n", filename);
  return filename;
}

void *create_file_selection(void) 
{
file_selection_box = gtk_file_selection_new("Please select a file for
editing.");

/* Link the ok button to the store_filename function */   
  gtk_signal_connect (GTK_OBJECT
(GTK_FILE_SELECTION(file_selection_box)->ok_button),"clicked",
GTK_SIGNAL_FUNC (store_filename), NULL);
                             
/* Destroy the dialog box when the user clicks the ok_button */
  gtk_signal_connect_object (GTK_OBJECT
(GTK_FILE_SELECTION(file_selection_box)->ok_button),"clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), (gpointer) file_selection_box);

/* Destroy the dialog box when the user clicks the cancel_button */
  gtk_signal_connect_object (GTK_OBJECT
(GTK_FILE_SELECTION(file_selection_box)->cancel_button),"clicked",
GTK_SIGNAL_FUNC (gtk_widget_destroy), (gpointer) file_selection_box);
     
gtk_widget_show (file_selection_box);
}

then in main()

[..]
entry = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entry), "Some text"); 
gtk_entry_append_text(GTK_ENTRY(entry), filename);

but the bottom line doesnt pass the value of "filename" to
gtk_entry_append_text, what am i doing wrong?


-- 
mdew <mdew mdew dyndns org>




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