I’ve mostly converted myapp from Glade/GTK3+ to GTK4, but I’ve spent a lot of time unsuccessfully trying to add the logo to the AboutDialog.
The documentation suggests it needs to be a “paintable” object. I can make a paintable object and add it, but it doesn’t seem possible to add the image file to the paintable object. I’ve probably misunderstood something fundamental here.
dialogue = Gtk.AboutDialog()
paintable = Gdk.Paintable.new_empty(200, 100)
dialogue = Gtk.AboutDialog(logo = paintable)
# get an image
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale('/home/chris/myapp.png', 5000, 2000, True)
image = Gtk.Image()
image.set_from_pixbuf(pixbuf)
# now need to set 'paintable' to a pixbuf or image.
Alternatively I have seen an example which just sets it to an existing icon - but that doesn’t work.
dialogue.set_logo_icon_name('com.github.appmaker.myapp.png')