How do I use GtkAlertDialog with GtkBuilder?

I’m trying to show a dialog asking for user input. I read in the documentation for GtkMessageDialog that it has been deprecated and that I should use GtkAlertDialog. However, the new widget doesn’t implement the buildable interface, so I cannot use it in my .ui file. Is there a particular reason why this wasnt implemented? Are there any plans to do so? Is there another way to use the widget I’m not realizing?

GtkAlertDialog is not an object you construct from a UI definition file: it’s an object you create and run programmatically to alert the user.

If you’re building the contents of the dialog then you should not use GtkMessageDialog in the first place: you should create your own class that derives from GtkWindow. Alternatively, if you can use libadwaita, then you can use AdwMessageDialog.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.