Please add a Gtk.MessageDialog
Please add a Gtk.MessageDialog to e.g. display an error or a hint. And close button.
Thanks ...
I tried this, but the dialog does not appear. No error message.
def error(self, error_msg):
self.dialog = Gtk.MessageDialog(
buttons = Gtk.ButtonsType.OK,
modal = True,
title = ("Error"),
text = (error_msg),
transient_for = self)
self.dialog.connect('response', lambda d,i: d.destroy())
self.dialog.show()
There seems to be something missing I think...
...
In a quick test that code above does seem to work for me
Not for me, no dialog box appears. I have no idea why.
Am 12.11.22 um 07:58 schrieb Taiko2k:
In a quick test that code above does seem to work for me
— Reply to this email directly, view it on GitHub https://github.com/Taiko2k/GTK4PythonTutorial/issues/10#issuecomment-1312392397, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKGJLRML5VWEE7MIUIEGLRLWH45YPANCNFSM6AAAAAARXZ3ITM. You are receiving this because you authored the thread.Message ID: @.***>
Small addendum: I took everything according to your code base. Only the dialog I have searched together.
Am 12.11.22 um 07:58 schrieb Taiko2k:
In a quick test that code above does seem to work for me
— Reply to this email directly, view it on GitHub https://github.com/Taiko2k/GTK4PythonTutorial/issues/10#issuecomment-1312392397, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKGJLRML5VWEE7MIUIEGLRLWH45YPANCNFSM6AAAAAARXZ3ITM. You are receiving this because you authored the thread.Message ID: @.***>
Just to double check, you did call the error() function at some point?
Yes, of course.
I will try again tonight after work.
Am 12.11.22 um 14:40 schrieb Taiko2k:
Just to double check, you did call the |error()| function at some point?
— Reply to this email directly, view it on GitHub https://github.com/Taiko2k/GTK4PythonTutorial/issues/10#issuecomment-1312480628, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKGJLRK2BIF6WEQONCG2SKTWH6M6DANCNFSM6AAAAAARXZ3ITM. You are receiving this because you authored the thread.Message ID: @.***>
I don't even want to say it, it's my own fault. I had a self.close() in the script where it didn't belong. Now the dialog works.
Sorry for the inconvenience :-)
Do you maybe already have an example gtk4 grid?
thanks