-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
Native Integration - Linux: Implement alert API using GtkMessageDialog #278
Comments
@bryphe this is definitely outside my wheelhouse but would be up for giving this a shot I use Linux on my home machine so would be keen to get linux related functionality like this working |
@Akin909 - that would be great! This would be a fun way to try out some C/C++ code if you're up for it 😄 My recommendation is to try compiling a simple GTK app with C before trying to do the interop with the OCaml side - this looks like a good tutorial: https://developer.gnome.org/gtk3/stable/gtk-getting-started.html (That way, you have confidence that the C part works - and then, its just a matter of wiring things up to Revery). Let me know if you need any help getting started |
Having a look at https://ocaml.org/learn/tutorials/introduction_to_gtk.html
might be useful as well
…On Wed, Jan 30, 2019, 01:37 Bryan Phelps ***@***.*** wrote:
@Akin909 <https://github.com/Akin909> - that would be great! This would
be a fun way to try out some C/C++ code if you're up for it 😄
My recommendation is to try compiling a simple GTK app with C before
trying to do the interop with the OCaml side - this looks like a good
tutorial: https://developer.gnome.org/gtk3/stable/gtk-getting-started.html
(That way, you have confidence that the C part works - and then, its just
a matter of wiring things up to Revery). Let me know if you need any help
getting started
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#278 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACx6npHn7-wI-Bh2wHQGlTCPknOJs9Aks5vIOlXgaJpZM4aYdeR>
.
|
@bryphe I've gone through the tutorial you recommended that was really helpful thanks 🙏 Re. the flags for |
@Akin909 - awesome, great progress! Note that there is both a I suspect you might need to add some of these flags to the |
Very early WIP implementation of gtk dialog alert to fix #278 (please ignore the commented out code etc. just trying to get stuff working) Progress so far: No longer chokes on `#include <gtk/gtk.h>` - currently need to tweak the borrowed snippet from #278 as an example to create an alert doesn't work as is, I think Things to note/note to self: - [x] I have to rework the `discover.ml` so it can use the pkg_config functionality on linux but behave as normal on other systems - [x] Fix GTK crash on opening dialog - things compile but the function to open a dialog causes a crash, note this also happens in a separate project when I try and create a dialog with the same function (might be specific to my machine or more likely a bug in the code)
Very early WIP implementation of gtk dialog alert to fix revery-ui#278 (please ignore the commented out code etc. just trying to get stuff working) Progress so far: No longer chokes on `#include <gtk/gtk.h>` - currently need to tweak the borrowed snippet from revery-ui#278 as an example to create an alert doesn't work as is, I think Things to note/note to self: - [x] I have to rework the `discover.ml` so it can use the pkg_config functionality on linux but behave as normal on other systems - [x] Fix GTK crash on opening dialog - things compile but the function to open a dialog causes a crash, note this also happens in a separate project when I try and create a dialog with the same function (might be specific to my machine or more likely a bug in the code)
Following up from #276 , which implements
alert
for OSX/Windows, this is tracking integrating a Gtk strategy for the 'alert' dialog on Linux. There's a few different pieces we'll need - right now, there is only a placeholder stub where the Linux strategy should be:revery/src/Native/dialog.cpp
Line 37 in 0beaee4
@tcoopman gave some very helpful suggestions - Electron uses GTK for its Linux platform UI - helpful PR is here: electron/electron#15293
A few considerations:
Dependencies
Will we need to add
libgtk-3-dev
as a dependency for our build environments?Build
We have a
discover.ml
script to help populate the right C compiler settings:revery/src/Native/config/discover.ml
Line 17 in 0beaee4
-I
) and libs (-lgtk3
). Is there a common place where this would usually be found? Or will we need something likepkg-config
to discover these?Functionality
The code snippets here seem very useful for create a dialog:
https://developer.gnome.org/gtk3/stable/GtkMessageDialog.html
Once we have the proper compilation settings, we should be able to use this code as-is. I believe for now we could pass
NULL
for the parent_window, until we have a good way to go from the X11 window handle fromglfwGetNativeWindow
to some GTK type.The text was updated successfully, but these errors were encountered: