[Glade-users] save as menu button



Hi everyone i doing my project and i have some problems with the menu save
button. I use glade2. Can anybody help me on that?

Here is the code:
void
on_save_as1_activate (GtkMenuItem *menuitem,
                                          gpointer user_data)
{
GtkWidget *dialog;
char *filename;

dialog = gtk_file_chooser_dialog_new ("Save As..  File",
                      NULL,
                      GTK_FILE_CHOOSER_ACTION_SAVE,
                      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                      GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
                      NULL);
gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog),
TRUE);

 gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), "/tmp");

if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
  {

   filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
   save_to_file(filename); <-------- Here is the problem when i compile it
   g_free (filename);
  }

gtk_widget_destroy (dialog);

}


Thanks for the help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20060227/db43f715/attachment.html



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