# Converting Gtk.GtkAspectFrame to Gtk4.jl

**URL:** https://discourse.julialang.org/t/converting-gtk-gtkaspectframe-to-gtk4-jl/108684
**Category:** Visualization
**Created:** [January 11, 2024, 1:23pm UTC](https://discourse.julialang.org/t/converting-gtk-gtkaspectframe-to-gtk4-jl/108684 "2024-01-11T13:23:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![xor0110](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xor0110/32/7926_2.png) [@xor0110](https://discourse.julialang.org/u/xor0110)
#### Post date: [January 11, 2024, 1:23pm UTC](https://discourse.julialang.org/t/converting-gtk-gtkaspectframe-to-gtk4-jl/108684/1 "2024-01-11T13:23:02Z")

</div>

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 can`t `push!` either. I have the impression perhaps this has moved to GtkFrame somehow? But then how does it work?..

---

<div class="post-metadata">

### Author: ![jwahlstrand](https://avatars.discourse-cdn.com/v4/letter/j/bcef8e/32.png) [@jwahlstrand](https://discourse.julialang.org/u/jwahlstrand)
#### Post date: [January 11, 2024, 2:10pm UTC](https://discourse.julialang.org/t/converting-gtk-gtkaspectframe-to-gtk4-jl/108684/2 "2024-01-11T14:10:18Z")

</div>

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

> **[Gtk: Migrating from GTK 3.x to GTK 4](https://docs.gtk.org/gtk4/migrating-3to4.html#gtkaspectframe-is-no-longer-a-frame)**
>
> Reference for Gtk-4.0: Migrating from GTK 3.x to GTK 4

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](https://juliagtk.github.io/Gtk4.jl/dev/manual/layout/#GtkFrame,-GtkAspectFrame,-and-GtkExpander)
