file selection usage question
- From: Dimitar Haralanov <mitko tahoenetworks com>
- To: gtk-app-devel-list gnome org
- Subject: file selection usage question
- Date: Fri, 20 Sep 2002 16:20:16 -0700
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]