Re: Save dialog upon exiting



On Sat, 2004-02-21 at 05:01, Robert Pyzalski wrote:
Hello GTK programmers,
I've got a program that pops up a modal dialog upon exiting asking wether 
to save changes. The dialog is called using gtk_dialog_run().
The delete_event handler calls this dialog:

g_signal_connect_swapped(G_OBJECT(main_win), "delete_event", 
G_CALLBACK(Exit_Program), G_OBJECT(main_win));

static gboolean Exit_Program()
{ if (!Save_Changes_Warning())
       return TRUE;

   gtk_main_quit();
   return FALSE;
}

This works except for one annoyance. If this callback is called from the 
menu everything works fine. If this is called when a user clicks the main 
window's "X" or closes the program from the window frame's menu the main 
program window gets buried underneath all of the other open windows. Does 
anyone know what I'm doing wrong?

Robert P.

Why wouldn't you save the settings automatically, rather than hit the
user with a dialog? One less thing to confuse them with. "Ah, a dialog
box, how do I make it go away, I'll hit no."




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