I have a window in a Vala application and an image inside it. Sometimes this image sometimes changes to img.set_from_pixbuf(imgdata); , and therefore the size changes. It is built into Gtk.Box.
box = new Gtk.Box(Orientation.VERTICAL,5); ... box.pack_end(img,false,false);
So, if there was a large image before, and I replace it with a smaller one, the window remains ridiculously large, and I did not find a way to dynamically reduce it to the desired location. I tried with window.set_default_size(box.width_request,box.height_request) , but it always returns -1.
So, any ideas on how to resize a window? Thanks!
source share