# Julia for GUI app

**URL:** <https://discourse.julialang.org/t/julia-for-gui-app/416>\
**Category:** General Usage\
**Created:** [November 18, 2016, 3:20pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416 "2016-11-18T15:20:50Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![lobingera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lobingera/32/211_2.png) [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Post date:** [November 20, 2016, 3:46pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/21 "2016-11-20T15:46:20Z")

</div>

a few random thoughts:

Current Gtk is rendering everything via Cairo + Pango. Their future plans is to drop Cairo and use a new toolbox with GL/EGL rendering (see [halting problem - gsk demystified](https://www.bassi.io/tag/gsk-demystified/)).

Yes, layout is hard. But the hard part isn’t solving the constraints, it’s formulating the problem.

Keep in mind, that both Qt and PyQt are commercial products with some ‘free’ licensing.

PyQt is doing all the heavy lifting between python and a C++ library, it’s not like the effort isn’t spend, it’s just hidden.

A drawing canvas is a rather simple thing, for any interactive UI, jou need a responsive canvas or a scene toolkit.

Hardest thing (speaking about hard problems): Find people to work on this. The ratio of users to developers is close to inf.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [November 20, 2016, 4:13pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/22 "2016-11-20T16:13:16Z")

</div>

> [@gour](#):
>
> I’m just exploring Python vs Julia and not being aware of JuMP, can you explain a bit connection with GUIs?

It solves optimization problems, so he’s saying you can use it to optimize widget locations according to some cost function to have it all be done automatically. That would be an interesting idea. If not interesting, at least fun to explore and pretty boss if you get it right, boss enough that you have to put on some shades to mask others from your awesomeness. So I totally agree:

> [@StefanKarpinski](#):
>
> Part of the problem seems to be automatic widget layout, which is a notoriously hard problem, but one which Julia is well-positioned to address since we’ve got JuMP 🕶.

---

<div class="post-metadata">

**Author:** ![tknopp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tknopp/32/3569_2.png) [@tknopp](https://discourse.julialang.org/u/tknopp)\
**Post date:** [November 20, 2016, 4:28pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/23 "2016-11-20T16:28:03Z")

</div>

> Hardest thing (speaking about hard problems): Find people to work on this. The ratio of users to developers is close to inf.

well said.

Thats why I really suggest people wanting to write UI try Gtk.jl which is in a pretty usable state. Several members of the Julia community have put quite some effort in ensuring that installing Gtk.jl is as easy as Pkg.add(“Gtk.jl”). There are people using Gtk.jl in larger projects and there have not been that much complaints.

The most serious issue currently is that Gtk.jl lacks developer manpower.

---

<div class="post-metadata">

**Author:** ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Post date:** [November 20, 2016, 10:44pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/24 "2016-11-20T22:44:03Z")

</div>

I’ve used Gtk.jl quite a bit, and looked at alternative and I think it’s the best option right now. There’s is plenty of issues with it but you can still work around them for the most part (it’s somewhat broken on 0.5 though at the moment).

> But my problem with Gtk is that it really is very rough on Windows (and also Mac), unless I have missed something. And this is made even worse on very high resolution displays.

I don’t know if that’s your issue, but I think anti-aliasing is not enabled by default on windows (there’s no settings.ini file) and fonts looks horrendous as a result.

---

<div class="post-metadata">

**Author:** ![jtravs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jtravs/32/2010_2.png) [@jtravs](https://discourse.julialang.org/u/jtravs)\
**Post date:** [November 20, 2016, 10:44pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/25 "2016-11-20T22:44:05Z")

</div>

@tknopp I agree that Gtk.jl is a great piece of work and appreciate the effort that went into it. But Gtk itself really does leave a lot to be desired and this have been a long standing complaint from Mac and Windows users. WxWindows and Qt on the other hand are well established and do look fine.

As I’m not volunteering to work on this I realise I have a small (or insignificant voise), but as a data point: Gtk really does not look fine to me and my users, to the extent that I am forced to use PyQt from Julia, which is clearly sub-optimal (I would like to try Qml.jl but can’t install it on Windows at the moment).

Here is a screenshot giving a small example of the poor quality of Gtk (notice the difference between the native title bar and the actual GUI):

 ![](https://global.discourse-cdn.com/julialang/original/3X/e/7/e7aefd051b176ec093067622da20b5487e9c837d.png)

Qt, Wx, libui do not have this problem, which is why it is a little frustrating that the best maintained and designed GUI library for Julia is something different.

---

<div class="post-metadata">

**Author:** ![jtravs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jtravs/32/2010_2.png) [@jtravs](https://discourse.julialang.org/u/jtravs)\
**Post date:** [November 20, 2016, 11:13pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/26 "2016-11-20T23:13:43Z")

</div>

Well on HiDPI displays you are supposed to not need anti-aliasing as much (my display is 3840x2160).

It looks like Windows support for HiDPI in Gtk is actually on its way finally (as of this month): [https://git.gnome.org/browse/gtk+//commit/?id=6abd65c83be6ba4656c5f014bc940c2eea21dfd0&utm\_source=anzwix](https://git.gnome.org/browse/gtk+//commit/?id=6abd65c83be6ba4656c5f014bc940c2eea21dfd0&utm_source=anzwix)

And if I remove the DPI scaling option in Windows, by pretending that Gtk.jl is already HiDPI aware, then it starts look OK (albeit with tiny fonts and GUI elements):

![](https://global.discourse-cdn.com/julialang/original/3X/a/9/a94b14a390192ec1547c3911a3dad9731de7c2b9.png)

So this might be useable after all!

---

<div class="post-metadata">

**Author:** ![tknopp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tknopp/32/3569_2.png) [@tknopp](https://discourse.julialang.org/u/tknopp)\
**Post date:** [November 20, 2016, 11:14pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/27 "2016-11-20T23:14:54Z")

</div>

have you tried enabling antialiasing?

[http://forum.gtkd.org/groups/GtkD/thread/57/](http://forum.gtkd.org/groups/GtkD/thread/57/)

Other than this font issue, I cannot see the _poor_ quality of Gtk in your screenshot.

But I think we are actually discussing different things here. There is usability of the API, usability of the widgets and the visual experience. If the last is the most important to you it is certainly better choosing Qt or Wx.

---

<div class="post-metadata">

**Author:** ![jtravs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jtravs/32/2010_2.png) [@jtravs](https://discourse.julialang.org/u/jtravs)\
**Post date:** [November 20, 2016, 11:31pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/28 "2016-11-20T23:31:35Z")

</div>

I’m not sure if that is sufficient. Asking all users to set this obscure setting buried deep inside the Gtk dependency is hardly user friendly (unless we can make it default on Gtk installations). And it doesn’t improve much (again, compare to title bar):

 ![](https://global.discourse-cdn.com/julialang/original/3X/d/2/d20a7520f6578cf1a1d2798d6d916afe86a8995f.png)

As I mentioned above anti-aliasing is not the solution, but proper handling of HiDPI is. Luckily it looks like Gtk have finally got round to supporting that. Upon further investigation, the workaround I noted in my previous post, of pretending that Gtk handles HiDPI doesn’t work as the fonts become unreasonably tiny.

I’ve said repeatedly above that the API and widgets are excellent. It is the visual appearance I am discussing and this really is important. I, and I suspect most people, would like both a good API and good appearance! Maybe with an upgraded Gtk we can get that, but currently I’ll have to stick with PyQt or possibly (hopefully) QML.jl or libui.

Thanks for the suggestions! I really don’t want to come across as sour or ungrateful here, but trying to provide an additional perspective on this.

---

<div class="post-metadata">

**Author:** ![gour](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gour/32/2007_2.png) [@gour](https://discourse.julialang.org/u/gour)\
**Post date:** [November 21, 2016, 8:47am UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/29 "2016-11-21T08:47:40Z")

</div>

> [@jtravs](#):
>
> WxWindows and Qt on the other hand are well established and do look fine.

However, both require lot of work to bind them.

> [@](#):
>
> I am forced to use PyQt from Julia, which is clearly sub-optimal

Do you use PyCall for that?

---

<div class="post-metadata">

**Author:** ![lobingera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lobingera/32/211_2.png) [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Post date:** [November 21, 2016, 9:51am UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/30 "2016-11-21T09:51:22Z")

</div>

> [@jtravs](#):
>
> I really don’t want to come across as sour or ungrateful here

the julia community -in general- is interested in solving problems, not only endlessly discussing them. Your example is now quite concrete, initially it sounded like ‘no way’, now it’s visible as problem of configuration and rendering. But it looks solvable.

The Windows display engine is notorious for these scaling issues (in your example the rendering in Gtk assumes the wrong window size and is scaled up), i think i even have seen PyQT4 Examples with the same issue.

Thanks for sharing the screenshot.

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [November 21, 2016, 11:24am UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/31 "2016-11-21T11:24:45Z")

</div>

I really hope to provide a viable option for native cross platform GUIs with GLVisualize, which are flexible, with easy automatic options, fast and customizable!  
I will announce it officially somewhere today, but the blog post is already up if you want to check it out:  
[http://randomfantasies.com/2016/11/glvisualize-a-modern-graphics-platform-for-julia/](http://randomfantasies.com/2016/11/glvisualize-a-modern-graphics-platform-for-julia/)

Better looks and better automatic layout could be a community effort 😉

---

<div class="post-metadata">

**Author:** ![Evizero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evizero/32/10118_2.png) [@Evizero](https://discourse.julialang.org/u/Evizero)\
**Post date:** [November 21, 2016, 11:59am UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/32 "2016-11-21T11:59:17Z")

</div>

Just a side-note: I watched your youtube video just yesterday and was really impressed. Hope I get around to try it out really soon. Really nice work

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [November 21, 2016, 3:28pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/33 "2016-11-21T15:28:21Z")

</div>

> [@gour](#):
>
> I’d say that e.g. wxWidgets & Qt are “good-enough”, don’t you think so?

They’re certainly among the better cross-platform GUI toolkits, but I generally find that they each have a characteristic non-native look about them. They are among the best choices though aside from building multiple platform-specific GUIs with native toolkits.

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [November 22, 2016, 2:27pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/34 "2016-11-22T14:27:09Z")

</div>

> [@](#):
>
> [quote]If Qt with its C++ baggage is too much, then maybe [GitHub - andlabs/libui: Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.](https://github.com/andlabs/libui) and [GitHub - joa-quim/Libui.jl: Julia wrapper to the libui GUI library](https://github.com/joa-quim/Libui.jl) might be a nice solution; but I haven’t looked into it much yet.

That’s interesting - I was looking at libui when I was considering to use Go, but it looks that GUI is not the right niche for it.

However, I haven’t thought there might be Julia bindings for it.  
[/quote]

I did the Libui.jl binding before the summer when the project was having lots of momentum and seamed very promising. However, and frustratingly, the activity have stalled and I don’t know when/if it will resume. Buttons and menus are fine (see the site for screen shots, that’s what we get with Julia binding too) but it’s not even yet possible to display an image [see](https://github.com/andlabs/libui/issues/210).

I am also very interested in creating GUIs in Julia but can’t get convinced with GTK. I keep having the feeling that one day it will suddenly disappear.

I also follow Simon’s work that we all acknowledge as amazing, but while it doesn’t have Menus and a more classical set of Buttons it’s not there yet.

@sdanisch, it would be nice if you could makes a post on your plans about this and what you think will be possible to do. Another very important issue is the capability to plot both raster and vector data in the same figure and be able to interact with the vector data (uicontext menus àla Matlab, etc…)

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [November 22, 2016, 4:22pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/35 "2016-11-22T16:22:57Z")

</div>

> [@joa-quim](#):
>
> have Menus and a more classical set of Buttons it’s not there yet.

Please feel free to open issues with feature request. That makes it easier for me to prioritize.  
Best with some example images of what you’re looking for. Adding new button and menu types shouldn’t take much time 🙂

> [@joa-quim](#):
>
> Another very important issue is the capability to plot both raster and vector data in the same figure and be able to interact with the vector data (uicontext menus àla Matlab, etc…)

I don’t know Matlab that well, but it should be no problem 😉 Depending on what you’re looking for it should work out of the box.

---

<div class="post-metadata">

**Author:** ![lobingera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lobingera/32/211_2.png) [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Post date:** [November 22, 2016, 6:47pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/36 "2016-11-22T18:47:50Z")

</div>

> [@sdanisch](#):
>
> Adding new button and menu types shouldn’t take much time

Whose time? It’s nice if you want to put this on your agenda, but in the mid-long term it should easy to add something from the users side.

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [November 22, 2016, 6:50pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/37 "2016-11-22T18:50:12Z")

</div>

Well Simon, there is already an open [issue](https://github.com/JuliaGL/GLVisualize.jl/issues/82). In simple 😇 terms, I need the features that allow me to port the entire [Mirone](http://w3.ualg.pt/~jluis/mirone/screeshots.html) into Julia

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [November 22, 2016, 7:33pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/38 "2016-11-22T19:33:25Z")

</div>

That’s the goal! It should be possible right away, but I’m not 100% happy with the design of the current API.  
It misses a coherent vision.  
A big thing that I want to do next is to grab all the Julia devs involved in graphics and GUIs and try to design a more coherent API for interactions and GUIs. Probably not restricted to GLVisualize.  
More like trying to figure out a Julian way to do this nicely, and I will make sure that GLVisualize supports it first class.

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [November 22, 2016, 7:50pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/39 "2016-11-22T19:50:24Z")

</div>

Oh, of course! Almost forgot about it!

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [November 22, 2016, 7:53pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/40 "2016-11-22T19:53:15Z")

</div>

Count me in. I have extended Matlab GUI experience but only minor on Julia.

[Previous page](https://discourse.julialang.org/t/julia-for-gui-app/416.md?page=1)

[Next page](https://discourse.julialang.org/t/julia-for-gui-app/416.md?page=3)
