Browse code

Set parent window for dialogs.

Otherwise, GTK3 complains.

Steven Allen authored on 29/04/2016 16:51:00 • Jose Fonseca committed on 29/04/2016 23:01:34
Showing 1 changed files

  • xdot.py index bcbe4a9..eac4709 100755
... ...
@@ -2092,7 +2092,8 @@ class DotWindow(Gtk.Window):
2092 2092
             self.error_dialog(str(ex))
2093 2093
 
2094 2094
     def on_open(self, action):
2095
-        chooser = Gtk.FileChooserDialog(title="Open dot File",
2095
+        chooser = Gtk.FileChooserDialog(parent=self,
2096
+                                        title="Open dot File",
2096 2097
                                         action=Gtk.FileChooserAction.OPEN,
2097 2098
                                         buttons=(Gtk.STOCK_CANCEL,
2098 2099
                                                  Gtk.ResponseType.CANCEL,
... ...
@@ -2120,7 +2121,8 @@ class DotWindow(Gtk.Window):
2120 2121
         self.dotwidget.reload()
2121 2122
 
2122 2123
     def error_dialog(self, message):
2123
-        dlg = Gtk.MessageDialog(type=Gtk.MessageType.ERROR,
2124
+        dlg = Gtk.MessageDialog(parent=self,
2125
+                                type=Gtk.MessageType.ERROR,
2124 2126
                                 message_format=message,
2125 2127
                                 buttons=Gtk.ButtonsType.OK)
2126 2128
         dlg.set_title(self.base_title)