Gtk.AlertDialog not working from Python

Hi! I’m trying to create a Gtk.AlertDialog through PyGobject but I get the error AttributeError: 'gi.repository.Gtk' object has no attribute 'AlertDialog'. Gtk.FileDialog also is not working. The docs suggest they were implemented in version 4.1, but I’m using Gtk 4.6.9. Would anyone have any thoughts?

Gtk.AlertDialog was introduced in GTK 4.10, not 4.1:

Screenshot from 2024-05-28 23-34-30

If you’re using GTK 4.6.9 (which was released in December 2022) then you don’t have access to that class.

1 Like

Yep, that would do it. My bad!