<p>Hello all,</p>
<p>I am curious to see if there is a cross platform native GUI available for golang. It must be pure go, no HTML/CSS or C bindings.</p>
<p>If there is not one, could anyone give me an explanation of why? Is it not possible? Has no one has made one yet?</p>
<p>I am currently using andlabs/ui as that is the best option for me right now but has C bindings.</p>
<p>Suggestions appreciated, Thanks!</p>
<hr/>**评论:**<br/><br/>megromby: <pre><p>Unless you have an unusual definition of "native" you can't have a "native GUI" without C bindings for the simple reason that the native GUIs of Windows and MacOS are <strong><em>written in C</em></strong> (and C++/Obj-C).</p></pre>SeriousNerve: <pre><p>Is there no such thing as not making win32api syscalls and being able to have a native gui? What you are saying makes sense, I was just curious. Thanks!</p></pre>TheMerovius: <pre><p>a) syscalls are, in general, to communicate with the kernel, not the windowing/desktop system and b) Windows/MacOS don't provide stable syscall APIs, AFAIK, but instead provide the stable kernel APIs as C-libraries which gets released in lock-step with the kernel.</p></pre>sbinet: <pre><p>there's <code>duit</code>:</p>
<ul>
<li><a href="https://github.com/mjl-/duit" rel="nofollow">https://github.com/mjl-/duit</a></li>
</ul>
<p>pure-Go, with an eye to the plan9-way of doing things. (which, really, are probably the same things)</p></pre>tomarus: <pre><p>I've created <a href="https://github.com/tomarus/go-gui-libs/wiki" rel="nofollow">a wiki</a> a while ago to compare all GUI packages i could find. So far i haven't really decided which one to use yet.</p></pre>kodablah: <pre><p>You have asked for a native GUI library, but aren't willing to have bindings to the native GUI. I mean there are a couple of things like the basically unmaintained <a href="https://godoc.org/golang.org/x/exp/shiny" rel="nofollow">https://godoc.org/golang.org/x/exp/shiny</a> in pure Go (but even it has bindings to native layers), but of course it's not going to be "native" unless by "native" you mean something other than deferring to the native OS widgets. Why do you have a problem with C bindings?</p></pre>SeriousNerve: <pre><p>Thanks for the comment. The issue I have with C bindings is cgo. I have to wait through long compile times and I can't cross compile for mac.</p></pre>philiplb: <pre><p>Hm, a wrapper for libui, which itself is written in C: <a href="https://github.com/andlabs/ui/issues" rel="nofollow">https://github.com/andlabs/ui/issues</a></p>
<p>Comes with precompiled .a files for the platforms afaik.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传