Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gtk not working on MacOS Sonoma 14.4 or 14.4.1 #698

Closed
JeffFessler opened this issue Apr 8, 2024 · 1 comment
Closed

Gtk not working on MacOS Sonoma 14.4 or 14.4.1 #698

JeffFessler opened this issue Apr 8, 2024 · 1 comment

Comments

@JeffFessler
Copy link
Contributor

JeffFessler commented Apr 8, 2024

The MWE code below works perfectly fine on MacOS Ventura 13.6.6 but on Sonoma 14.4.1 it produces numerous warnings like this:

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

I am using Julia 1.10.2 and Gtk v1.3.0 in both cases. (There could be other environment differences and I cannot pin down exactly when it stopped working.)

Furthermore, the GUI shows just a blank white screen at first, and only after moving the mouse into the GUI and clicking and moving the mouse out again does the "Click Me" text finally appear. This is a disastrous state for trying to use Gtk with Sonoma. I am teaching a class where >60 students are trying to use GUIs like this so I am pleading for help!

This code was working earlier this semester, so it is possible that Sonoma 14.4 (Mar. 7) or 14.4.1 (Mar. 25) caused it to stop working. If anyone could test with Sonoma 14.3 that would be helpful!

The code is based on https://juliagraphics.github.io/Gtk.jl/latest/manual/gettingStarted

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)

Edit: actually I am now getting the same error with MacOS Ventura 13.6.6. Unclear what changed. Earlier in the semester it worked on some version of MacOS...

@JeffFessler
Copy link
Contributor Author

Update: I've since learned that Gtk3 is no longer supported and #699 updates the README to spare others from my headaches. I close the issue since it is unlikely to ever be addressed and it seems that migrating to Gtk4 is easy enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant