0

I'm trying to make a modal FileChooserDialog using PyGObject.

The example at https://github.com/sebp/PyGObject-Tutorial/blob/master/examples/filechooserdialog_example.py works as expected, except that when the file chooser dialog is shown, I can still use the main window (including clicking the button to open a second dialog).

I've tried adding flags=Gtk.DialogFlags.MODAL when creating the dialog (line 23), but that doesn't work. I get no error, but I can still open a second dialog without closing the first one.

If I use a MessageDialog with the MODAL flag, it works exactly as expected. But I need a file chooser.

Is there any quick solution or am I better off rolling my own Dialog that contains a FileChooser?

Thanks in advance.

Vlad Dogaru
  • 1,166
  • 6
  • 11

0 Answers0