Index: gtk.override
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/gtk/gtk.override,v
retrieving revision 1.152
diff -u -u -r1.152 gtk.override
--- gtk.override	17 Oct 2002 03:13:18 -0000	1.152
+++ gtk.override	21 Oct 2002 16:45:37 -0000
@@ -3295,14 +3295,30 @@
   gtk_get_current_event gtk_get_event_widget gtk_propagate_event
 %%
 override gtk_main noargs
+gboolean python_do_pending_calls(gpointer data)
+{
+    Py_MakePendingCalls();
+
+    if (PyErr_Occurred()) {
+	PyErr_SetNone(PyExc_KeyboardInterrupt);
+    }
+    
+    return TRUE;
+}
 static PyObject *
 _wrap_gtk_main(PyObject *self)
 {
+    guint signal_id;
+    
     pyg_unblock_threads();
+    signal_id = gtk_timeout_add(100, python_do_pending_calls, NULL);
     gtk_main();
+    gtk_signal_remove(signal_id);
     pyg_block_threads();
+    
     if (PyErr_Occurred())
 	return NULL;
+        
     Py_INCREF(Py_None);
     return Py_None;
 }
@@ -3322,6 +3338,23 @@
     pyg_block_threads();
     return PyInt_FromLong(ret);
 }
