# Gtk stopped working on MacOS in March or April 2024

**URL:** https://discourse.julialang.org/t/gtk-stopped-working-on-macos-in-march-or-april-2024/112904
**Category:** Visualization
**Tags:** question, package
**Created:** [April 13, 2024, 1:35pm UTC](https://discourse.julialang.org/t/gtk-stopped-working-on-macos-in-march-or-april-2024/112904 "2024-04-13T13:35:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![JeffFessler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jefffessler/32/6650_2.png) [@JeffFessler](https://discourse.julialang.org/u/JeffFessler)
#### Post date: [April 13, 2024, 1:35pm UTC](https://discourse.julialang.org/t/gtk-stopped-working-on-macos-in-march-or-april-2024/112904/1 "2024-04-13T13:35:47Z")

</div>

Gtk stopped working for me on MacOS sometime this semester (I am teaching a music signal processing course using Julia with \>60 students). Here is a MWE of code that worked a month or so ago and now does not work on MacOS 13.6.6 or 14.4.1 (it is likely that I’ve done security updates for both versions during the term):

```julia
using Gtk

win = GtkWindow("My First Gtk.jl Program", 400, 200)

b = GtkButton("Click Me")
push!(win,b)

function on_button_clicked(w)
  println("The button has been clicked")
end
signal_connect(on_button_clicked, b, "clicked")

signal_connect(win, "key-press-event") do widget, event
	println("You pressed key ", event.keyval)
end

showall(win)

```

I am using Julia 1.10.2 and Gtk v1.3.0 in both cases.

The error message is: `(<unknown>:18639): Gtk-WARNING **: 21:31:19.255: drawing failure for widget 'GtkButton': the surface type is not appropriate for the operation`

I reported the issue [Gtk not working on MacOS Sonoma 14.4 or 14.4.1 · Issue #698 · JuliaGraphics/Gtk.jl · GitHub](https://github.com/JuliaGraphics/Gtk.jl/issues/698) but I wanted to see if anyone in the broader Julia community is able to get Gtk to work on any version of MacOS. This has been a big headache for my students (and me).

---

<div class="post-metadata">

### Author: ![Ralph\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralph_smith/32/10344_2.png) [@Ralph\_Smith](https://discourse.julialang.org/u/Ralph_Smith)
#### Post date: [April 13, 2024, 4:04pm UTC](https://discourse.julialang.org/t/gtk-stopped-working-on-macos-in-march-or-april-2024/112904/2 "2024-04-13T16:04:41Z")

</div>

Gtk.jl is no longer maintained. On the other hand, Gkt4.jl is alive and well, and routinely tested on MacOS. There is [a section in the manual](https://juliagtk.github.io/Gtk4.jl/dev/diff3to4/) which should help in porting your code.

---

<div class="post-metadata">

### Author: ![JeffFessler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jefffessler/32/6650_2.png) [@JeffFessler](https://discourse.julialang.org/u/JeffFessler)
#### Post date: [April 13, 2024, 4:38pm UTC](https://discourse.julialang.org/t/gtk-stopped-working-on-macos-in-march-or-april-2024/112904/3 "2024-04-13T16:38:41Z")

</div>

Oh my, I sure wish I knew that before the semester began!  
I’ll make PR at the repo.
