# How to detect a container resize event in GTK

**URL:** https://discourse.julialang.org/t/how-to-detect-a-container-resize-event-in-gtk/59624
**Category:** Visualization
**Tags:** gtk
**Created:** [April 19, 2021, 11:08pm UTC](https://discourse.julialang.org/t/how-to-detect-a-container-resize-event-in-gtk/59624 "2021-04-19T23:08:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![johntrinder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johntrinder/32/31783_2.png) [@johntrinder](https://discourse.julialang.org/u/johntrinder)
#### Post date: [April 19, 2021, 11:08pm UTC](https://discourse.julialang.org/t/how-to-detect-a-container-resize-event-in-gtk/59624/1 "2021-04-19T23:08:55Z")

</div>

I’ve scoured google but came up with nothing.  
I’ve done the following:  
id = signal\_connect(alig, “check-resize”) do widget, event  
println(“The window was resized”)  
end  
where ‘alig’ is a GtkAlignment to which I add a Canvas at run-time.

---

<div class="post-metadata">

### Author: ![johntrinder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johntrinder/32/31783_2.png) [@johntrinder](https://discourse.julialang.org/u/johntrinder)
#### Post date: [April 20, 2021, 12:01am UTC](https://discourse.julialang.org/t/how-to-detect-a-container-resize-event-in-gtk/59624/2 "2021-04-20T00:01:27Z")

</div>

Can’t find “check-resize” anywhere in the docs. “size-allocate” is the event I’m after

---

<div class="post-metadata">

### Author: ![Lilith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lilith/32/27492_2.png) [@Lilith](https://discourse.julialang.org/u/Lilith)
#### Post date: [August 16, 2022, 12:51am UTC](https://discourse.julialang.org/t/how-to-detect-a-container-resize-event-in-gtk/59624/3 "2022-08-16T00:51:28Z")

</div>

If you want register a callback for the `size-allocate` event, then pass `"size-allocate"` as the third argument of `signal_connect`. This works for me:

```julia
signal_connect(window, "size-allocate") do widget, event
    println("The window was resized")
end

```
