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

Lablgtk3 on macOS with quartz gtk3: all grey toplevel #136

Open
ghost opened this issue Sep 10, 2021 · 9 comments
Open

Lablgtk3 on macOS with quartz gtk3: all grey toplevel #136

ghost opened this issue Sep 10, 2021 · 9 comments
Labels
gtk3 Issue on the lablgtk3 branch

Comments

@ghost
Copy link

ghost commented Sep 10, 2021

Since opam can trigger rebuild of macports package, my gtk3 ports has been rebuilt using quartz rather than X11. Good thing, powerful feature of opam.

Unfortunately, I’m getting an all grey top-level window, I mean initialization of the gtk3 widgets does not happen correctly. Here’s a screenshot: https://discuss.ocaml.org/t/lablgtk3-on-macos-with-quartz-gtk3-underneath/8454.

By clicking approximatively on the location of a drop down menu, it does appear, but the rest of the widgets are still grey/inactive/uninitialized.

I’ve uploaded the “main” .ml file on the following URL: https://www.strauss-engineering.ch/tmp/straightliner.ml
Do I miss something about initialization or is it a bug?

Also, later on I've compiled the “examples” directory of the git lablgtk3 repos. and it’s even worse than my app: even a top-level window does not shows up with all those examples. The examples execute and terminate without showing anything, even not an error message on the console or syslog. I’ve compiled using:

for i in *.ml; do ocamlfind c -thread -o “$i.run” -package lablgtk3 -linkpkg; done
for i in *.ml; do ocamlfind opt -thread -o “$i.opt” -package lablgtk3 -linkpkg; done

HELP!

@ghost
Copy link
Author

ghost commented Sep 10, 2021

Oops I made a booboo about my screenshots and .ml file URL, you got to copy/paste the text of the link and not follow the href.

@ghost
Copy link
Author

ghost commented Sep 10, 2021

Software version & environment:
macOS (BigSur) 11.5.2, OCaml 4.12.0 using up-to-date opam installation, lablgtk3.1.1, macports up-to-date, gtk3 @3.24.23_0+quartz, cairo @1.16.0_2+quartz+x11;

philippe@air2:~/mysrc/straightliner$ cc -v
Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

philippe@air2:~/mysrc/straightliner$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Hardware: MacBook Air 9,1 (w. Retina, 13.3", late 2020, intel iris plus 1536Mo)

@ghost
Copy link
Author

ghost commented Sep 10, 2021

Oh about the lablgtk examples, my (ultra) bad, I've forgot to tell ocamlfind about the source file: $i shame on me.

@ghost
Copy link
Author

ghost commented Sep 11, 2021

The two links:
Screenshots and main gui .ml file

Regards.

@garrigue
Copy link
Owner

I see no call to GMain.init.
You should probably put one before let gui = new gui_t.
In LablGtk3 there is no GtkInit module, and one needs to call GMain.init explicitly.

@garrigue
Copy link
Owner

garrigue commented Sep 14, 2021

Looking at the code again, there is a call to GMain.init inside the constructor of gui_t.
I would still suggest to move it outside, as it would be safer, but this does not explain your problem.

Did you try to run the examples that come with lablgtk3 ? (download the sources to get them)

@ghost
Copy link
Author

ghost commented Sep 14, 2021 via email

@ghost
Copy link
Author

ghost commented Sep 14, 2021

Pretty strange, I was thinking, in the meantime after your message, Jacques, of a race about the use of React, BUT:

  • Placing the call to GMain.init on the top (first line) of the definition of class gui_t: it doesn't sigsegv, but shows the all greyed window with the active region of the combo box being sensitive and functional, not the rest.
  • Placing GMain.init right before the "new gui_t", it sigsegv

strange!

@ghost
Copy link
Author

ghost commented Sep 15, 2021

Under Linux, having the GMain.init right above new gui_t also sigsegv. Having it inside gui_t let bindings preamble, the app works fine, no all grey window like on macOS & Quartz, it does fully works.
Screenshot of the working GUI

@ejgallego ejgallego added the gtk3 Issue on the lablgtk3 branch label Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gtk3 Issue on the lablgtk3 branch
Projects
None yet
Development

No branches or pull requests

2 participants