-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add example code for gioui #80
base: master
Are you sure you want to change the base?
Conversation
For some reason, I could not run main.go on macOS from terminal. However, when I made a simple gioui gui app, it worked. I am adding it as it's useful for quick testing and actually seeing how the dialog runs. gioui is a simple UX framework that is multiplatform; what I like about it is you just need go with cgo to build it, the app code is just go, and there are no other steps. (Cross-building is still not really possible, though, as it is using cgo.) I have made example_gioui a separate module so installing dialog doesn't have all gioui as a dependency.
hmm, maybe it would be better to figure out what the gioui magic does so it can be replicated here... instead of adding the whole thing |
Ah figured it out, it's actually very simple, will make a PR |
gioui is great! I would not object to having an example ready to go :) Is the additional module necessary? None of the existing examples are separate modules but afaik they don't pull their extra dependencies in for users that don't try to run the examples (eg. |
Hm, maybe if I rename it from example to example_test or such, it will
become a test and dependents won't pull it. Otherwise I think the
dependents will need to pull whole gioui with its dependencies, just for
the example. (I... think)
Maybe we can just put it to a separate repo.
…On Sun 18. 2. 2024 at 11:02, sqweek ***@***.***> wrote:
gioui is great! I would not object to having an example ready to go :)
Is the additional module necessary? None of the existing examples are
separate modules but afaik they don't pull their extra dependencies in for
users that don't try to run the examples (eg. example/wde/)
—
Reply to this email directly, view it on GitHub
<#80 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAZT4O2HVYYVOGQPAWPAYDYUHGS5AVCNFSM6AAAAABDMLIQU6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJRGA3DEOJTGA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Look at
Which are not part of dialog's Because they are in a subdir you'd need to import (or ¹ actually dialog's |
Dialog's go.mod is not really correct; if you do |
If you do
However, you are correct that the dependents will not get it if it's just in example/. My bad. So I will just put it in example/gioui (btw the wde example doesn't seem to work for me at all) |
Also use this opportunity to update go.mod
I put it to example/gioui in this PR (and also updated go.mod while I was at it, with go1.21.7 as it's the latest oldstable) |
Haha damn, I tried to test this but:
I edited go.mod to read
I have go 1.18 😅 |
Ah ok, no that's not right either go.wde shouldn't be listed at all. Will have to look into how to do submodules properly in modern go. |
For some reason, I could not run main.go on macOS from terminal. However, when I made a simple gioui gui app, it worked.
I am adding it as it's useful for quick testing and actually seeing how the dialog runs.
gioui is a simple UX framework that is multiplatform; what I like about it is you just need go with cgo to build it, the app code is just go, and there are no other steps.
(Cross-building is still not really possible, though, as it is using cgo.)
I have made example_gioui a separate module so adding dialog as a dependency doesn't grab all gioui with it, just because of the example.