Save dialog upon exiting



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.




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