This worked fine with Glade/Gtk3+ but after conversion to PyGobject/GTK4 I can’t make it work. I have pixbuf images within boxes within boxes. The main image is supposed to expand to fill the space available, but doesn’t. A portrait image expands to fit the height available leaving the expected gaps on each side, but a landscape image only appears to expand until it is as wide as the available height - that may be coincidence. For testing I’ve simplified it to just one image inside the main window and it still doesn’t work.
- I use expand and fill on the window, boxes and images:
image1.props.hexpand = True
image1.props.vexpand = True
image1.props.halign = Gtk.Align.FILL
image1.props.valign = Gtk.Align.FILL
Is that enough, if not what should I be using?
- I want to rotate the images easily where necessary so use:
pixbuf = GdkPixbuf.Pixbuf.rotate_simple({see below}, 90)
and have tried:
GdkPixbuf.Pixbuf.new_from_file_at_scale(filename, width, height, True)
GdkPixbuf.Pixbuf.new_from_file_at_size(filename, width, height, True)
GdkPixbuf.Pixbuf.new_from_file_at_size(filename)
then
image1.set_from_pixbuf(pixbuf)
Should I be using something different?
I think I have tried all possible combinations available and have no more ideas!