Gtk.MessageDialog window parameter problems
- by William Culver
I'm in a deeply nested class (which inherits from Gtk.Box) and I need to get a reference to the GtkWindow I'm in to pass to a call to Gtk.MessageDialog() yet I cant seem to find a reference to it.
I have tried self.props.window as well as self.get_parent_window() with no avail.
Everything I try to do leads to the following error:
TypeError: Expected Gtk.Window, but got GObjectMeta
Code snippet is as follows:
def on_tb_del_clicked(self,widget):
question = _("Are you sure you want to do this?")
win = self.get_parent_window()
dialog = Gtk.MessageDialog(win,0,Gtk.MessageType.QUESTION,
Gtk.ButtonsType.YES_NO,question) # <<Exception
response = dialog.run()
Please help :)