-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fyne.io MenuItem type conflicting with systray MenuItem type #632
Comments
Confirmed that this is the issue. If I go through systray and change all references to their MenuItem to SMenuItem it works. Obviously modifying someone else's library is not optimal for applying future updates. There must be a way to use multiple libraries with overlapping variable names without crashing the compiler. Are the different package names not designed to prevent this conflict? |
You're quite right about the issue but slightly mistaken about the cause. Objective-C does not have the same namespace system and so manual namespacing is required - and we missed it. The function names should probably be prefixed if they are not part of the declared type. |
Ah ha! Thanks for the quick response. :)
…On Mon, Jan 27, 2020, 6:25 AM Andy Williams ***@***.***> wrote:
You're quite right about the issue but slightly mistaken about the cause.
Yes, Go packages stop this from happening. The error that you see is in
underlying Objective-C code.
If you change the fyne code in internal/driver/glfw/menu_darwin.m to
prefix MenuItem with Fyne or somesuch text then the problem should be
resolved.
Objective-C does not have the same namespace system and so manual
namespacing is required - and we missed it. The function names should
probably be prefixed if they are not part of the declared type.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#632?email_source=notifications&email_token=AAAUFLBVKUYIUJ36A7ALIW3Q73VDZA5CNFSM4KL2PC52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ7VV7I#issuecomment-578771709>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAUFLGSTG5LWYMU426UHKLQ73VDZANCNFSM4KL2PC5Q>
.
|
When it was fixed at your end did the app work? As I understand it both projects require the main loop grabbed... |
Yes. If I go into the menu_darwin.m file and change out (regex,
case-sensitive search) \bMenuItem\b for FyneMenuItem and replace all, then
run go run my application it works. Thanks!
…On Mon, Jan 27, 2020 at 7:44 AM Andy Williams ***@***.***> wrote:
When it was fixed at your end did the app work? As I understand it both
projects require the main loop grabbed...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#632?email_source=notifications&email_token=AAAUFLD3LHPDCLV6VJO72M3Q736NVA5CNFSM4KL2PC52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ766LQ#issuecomment-578809646>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAUFLABVKOG3CX3MFMMZ6LQ736NVANCNFSM4KL2PC5Q>
.
--
Best,
Dave
----------------------------------------------------
www.ThibaultFineArt.com
Painting the Places We Love
|
OK, the rename is going to be in 1.2.2 later this week |
Hello,
I'm trying to build my first Go app using Fyne for a gui toolkit and systray to create a system tray icon and menu.
When I try to compile I'm getting this error:
I'm 99% sure it's because both Fyne and Systray (github.com/getlantern/systray) create a new type called MenuItem.
Being new to Go , I'm not sure how to resolve this conflict. I'm using go version go1.13.6 darwin/amd64. I do have plenty of other programming experience in PHP, Javascript, and Python, so I'm not a total noob, but Go is a bit different with respect to its implementation of "object orientedness" (or lack thereof).
I appreciate your advice :)
Thanks!
Dave
The text was updated successfully, but these errors were encountered: