Cross platform native GUI library?

blov · · 717 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<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 &#34;native&#34; you can&#39;t have a &#34;native GUI&#34; 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&#39;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&#39;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&#39;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&#39;t really decided which one to use yet.</p></pre>kodablah: <pre><p>You have asked for a native GUI library, but aren&#39;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&#39;s not going to be &#34;native&#34; unless by &#34;native&#34; 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&#39;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

717 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传