Re: file selection usage question




 I don't see where you do a gtk_widget_show on the file selection. -- Also,
where is the code that handles the OK or Cancel button press on the file
selection ?

 Maybe that's what you are missing.

Harring


--- Dimitar Haralanov <mitko tahoenetworks com> wrote:
      Hi, I am new to this list and to GTK so, please, excuse me if the my
question is dumb!! I tried search the archive for an answer but did not
find one...

      I have a small app where one of the buttons is a save button. The
callback creates the file_selection window and the ok button in the file
selection window, sets a variable to the selected filename.

      I am having a problem in not being able to make the save callback
(which after creating the fileselection window, calls the save function)
wait for the fileselection to finish. I don't know whether I am making
myself clear here so let me give some code:

void
on_save_button_clicked                 (GtkButton       *button,
                                        gpointer         user_data)
{
  gchar *text = NULL;
  GList *children;
  GtkWidget *current_page;

  fileselection = create_fileselection ();
  D_PRINT(filename);
  current_page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook),                  
             gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook)));
  children = gtk_container_children (GTK_CONTAINER (current_page));
  if (GTK_IS_TEXT (children->data))
    text = gtk_editable_get_chars(GTK_EDITABLE(children->data), 0,
                                gtk_text_get_length(GTK_TEXT(children->data)));
  scratch_save_page_to_file (filename, text, FILE_MODE_NEW);
}

      In this code, the fileselection is created but the execution of the
callback continues. I would like to make it wait until the fileselection
window is closed.

      Any ideas? Thanx in advance for you help!!

              -- Mitko

-- 
========================================================================
     __  __  __________________ _________
    /  |/  |/  /__/__   ___/  |/  /     /      Dimitar Haralanov
   /          /  /  /  /  /      /  /  /       Software Engineer
  /   /   /  /  /  /  /  /  /\  \  /  /        Tahoe Networks
 /___/___/__/__/  /__/  /__/  |__|___/         mitko tahoenetworks com

========================================================================
  GPG Fingerprint:  21C1 8244 93F3 F2E9 013C  0C12 70DC C58E 6337 ABD1
-----------------------------------------------------------------------
-Nothing is so firmly believed as that which we least know.
              -- Michel de Montaigne
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


=====
"We should do smart things with stupid technology before we do stupid 
things with smart technology."
                              --Bill Buxton, Alias Research


Harring Figueiredo

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com



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