Converting Gtk.GtkAspectFrame to Gtk4.jl

There seems to be a few subtle changes between Gtk.jl to Gtk4.jl that I’m just not able to figure out by myself. Perhaps anyone has a clue?

In Gtk there’s a af = GtkAspectFrame("label", 0.5, 0.5, 4/3), that you can then push!(af, mywidget). How does it work in Gtk4? it seems there’s no label anymore, and you cant push!` either. I have the impression perhaps this has moved to GtkFrame somehow? But then how does it work?..

They dropped the label and decoration, GtkAspectFrame now only lets you control the aspect ratio:

So if you want the old behavior you could probably put a GtkAspectFrame inside a GtkFrame.

In Gtk4.jl widgets can be added to these by using setindex!(frame, child), or frame[]=child: Layout · Gtk4.jl

1 Like