# 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:** 19\
**Page:** 3

<div class="post-metadata">

**Author:** ![akis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/akis/32/156_2.png) [@akis](https://discourse.julialang.org/u/akis)\
**Post date:** [November 22, 2016, 8:57pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/41 "2016-11-22T20:57:34Z")

</div>

> [@sdanisch](#):
>
> 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.

Big vision! It would make a good topic in the [Visualization](https://discourse.julialang.org/c/domain/viz) category.

---

<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 22, 2016, 9:45pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/42 "2016-11-22T21:45:03Z")

</div>

I don’t want to sound negative on the great work on GLVizualize but I think their is still a distinction between this work and a classical UI framework.

Implementing something like Mirone should be pretty doable with Gtk.jl right now. All the menus and the toolbar can be done in a UI designer and the raster graphics could be drawn on a Cairo canvas including the ability to mix vector and raster graphic. I am doing just that in a project that uses Gtk.jl

---

<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, 10:20pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/43 "2016-11-22T22:20:40Z")

</div>

I see what you mean (and partially agree) but I have years of work in Mirone (Open Hub [estimates](https://www.openhub.net/p/mirone/estimated_cost) 49 😲) and from what I have read GTK is not particular fast in rendering big files and lots of vector elements. But above all, as I mentioned earlier, I fear that it is a dying technology. Off course I may be wrong but …

---

<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, 10:38pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/44 "2016-11-22T22:38:14Z")

</div>

> [@tknopp](#):
>
> I don’t want to sound negative on the great work on GLVizualize but I think their is still a distinction between this work and a classical UI framework.

No worries 😉 Can you elaborate on this?

---

<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 22, 2016, 10:45pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/45 "2016-11-22T22:45:34Z")

</div>

Yes porting such a big project is quite certainly much too much effort. But this holds true for any UI framework.

I don’t see why Gtk should be slow in rendering big images. This all goes through Cairo and if this is not fast enough (which I doubt given that you program Mirone in Matlab) one could use an OpenGL widget and still do alle the widgets with Gtk.

That you do not trust in Gtk’s future is something that you have to judge on your own. It seems to be actively developed, widely distributed and open source. So I would bet against that 😉

---

<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 22, 2016, 10:54pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/46 "2016-11-22T22:54:15Z")

</div>

For instance: A classical UI framework allows to open different windows (controlled by the window manager). It has predefined dialogs (open file / save file), scrollbars, and so on.

It this really the direction where you are heading with GLVizualize?

---

<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, 11:55pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/47 "2016-11-22T23:55:53Z")

</div>

> [@tknopp](#):
>
> I don’t see why Gtk should be slow in rendering big images. This all goes through Cairo and if this is not fast enough (which I doubt given that you program Mirone in Matlab) …

I was thinking more into vector renderings but let me tell you guys a secret. By not following TMW advice, avoiding doubles and `surface` objects at all cost and using older Matlab versions + some MEXing, one can do ML GUIs that work amazingly fast. For a lot of things, Mirone is (was when I tested it) way faster than QGis. It’s the vector part that screws with its absurd memory consumption.

But I’m diverging from issues in question in this thread, sorry.

---

<div class="post-metadata">

**Author:** ![barche](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barche/32/79_2.png) [@barche](https://discourse.julialang.org/u/barche)\
**Post date:** [November 23, 2016, 7:52am UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/48 "2016-11-23T07:52:51Z")

</div>

> [@tknopp](#):
>
> I don’t want to sound negative on the great work on GLVizualize but I think their is still a distinction between this work and a classical UI framework.

It is possible to combine both. QML.jl exposes a component that can be used as a GLVisualize screen, so you could combine an interactive viewport with classic Qt elements around (or even over) it. The current version of this is not compatible yet with the new GLVisualize interface, but I intend to have a working proof-of-concept on the first QML.jl release Real Soon Now ™ ;).

---

<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 23, 2016, 9:52am UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/49 "2016-11-23T09:52:49Z")

</div>

I do think so. In my experience, an interactive plotting libraries will need these anyways, so it’s not that far stretched. I’ve started with GLVisualize + Julia to minimize the 2 language problem, so it would be all for naught if you need a C/C++ library just for scrollbars 😛  
As I sketch out in the blog post: you really need to put development time into creating a nice general API that works seamlessly for interactive graphics or creating popups that interact with other parts of the app.  
And if you have that, creating e.g. a scrollbar or other popups is trivial. Which should be the general goal: make the interactive parts of GLVisualize so easy to use, that the user isn’t even aware, that he just created something you usually need a 25 year old ~8million LOC GUI library for.

But I guess it will mainly depend on the resources behind GLVisualize. If I will stay the sole developer of GLVisualize, it’s admittedly improbable that these things will happen (in a nice way) 😉  
So in the end we might need to settle for the great work that you, @barche or others are doing with 3rd party libraries. But it’s definitely not what I consider as ideal.

---

<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 23, 2016, 1:16pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/50 "2016-11-23T13:16:14Z")

</div>

yes a combination of both GL based fancy 3D visualization framework within a classical UI toolkit is a very promising approach. This is also what is done in various applications dealing with visualization. Just as an example, VTK is usually embedded into a Qt/Gtk interface.

---

<div class="post-metadata">

**Author:** ![vchuravy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vchuravy/32/8_2.png) [@vchuravy](https://discourse.julialang.org/u/vchuravy)\
**Post date:** [November 24, 2016, 12:28am UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/51 "2016-11-24T00:28:44Z")

</div>

Split this topic on November 24, 2016, 12:28am UTC

8 posts were split to a new topic: [Installing QML.jl](https://discourse.julialang.org/t/installing-qml-jl/533)

---

<div class="post-metadata">

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

</div>

@barche : Is it possible to obtain the `QWidget` and the `QPainter` reference for the plotting area used by your `QML` package? With this information `GR` could draw directly into the corresponding object without creating an intermediate image. That would be much faster.

Might sound crazy - but we’ve used this method for years …

---

<div class="post-metadata">

**Author:** ![barche](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barche/32/79_2.png) [@barche](https://discourse.julialang.org/u/barche)\
**Post date:** [November 24, 2016, 9:43pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/53 "2016-11-24T21:43:33Z")

</div>

> [@jheinen](#):
>
> Is it possible to obtain the QWidget and the QPainter reference for the plotting area used by your QML package? With this information GR could draw directly into the corresponding object without creating an intermediate image. That would be much faster.

Yes, I was planning to do this kind of thing. The QPainter is easy, but in QML there is no QWidget but a QQuickItem ([QQuickPaintedItem](http://doc.qt.io/qt-5/qquickpainteditem.html) here). Why is the QWidget needed? Also, how should these be passed to GR?

BTW, it may be best to discuss this in a github issue?

---

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [November 25, 2016, 8:21pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/54 "2016-11-25T20:21:08Z")

</div>

I want to use browser technology (HTML5 CSS3 javascript library + chrome / firefox / safari) as the basis off two way interaction (get user selections, track user mouse position and button press, show plots, autohighlight parts of a datatable that are of interest to the user). It would be much more complete as a medium with the ability to present and two-way play with Qt5+QML+QQuick windowed content and GR graphics plots. To have this available within the context of the DOM (webpage construction and dynamic content adjustment) would be ideal.

---

<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 26, 2016, 8:41am UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/55 "2016-11-26T08:41:20Z")

</div>

Could you express in a more non-compressed form? I cannot really follow what your question is

---

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [November 26, 2016, 8:52am UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/56 "2016-11-26T08:52:43Z")

</div>

thank you for asking, see above

---

<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 26, 2016, 5:32pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/57 "2016-11-26T17:32:55Z")

</div>

One can embed Webkit (i.e. Browser technology) in both Qt and Gtk if this is would you want.

---

<div class="post-metadata">

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

</div>

@tknopp I have read about that. Julia’s style seems better suited to having the Web realized part as the outermost deliverer of interactive technology. That way, I would think globally and refine incrementally.

---

<div class="post-metadata">

**Author:** ![barche](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barche/32/79_2.png) [@barche](https://discourse.julialang.org/u/barche)\
**Post date:** [November 26, 2016, 6:10pm UTC](https://discourse.julialang.org/t/julia-for-gui-app/416/59 "2016-11-26T18:10:29Z")

</div>

> [@jsarnoff](#):
>
> I want to use browser technology (HTML5 CSS3 javascript library + chrome / firefox / safari) as the basis off two way interaction

I think in Julia [Escher.jl](https://github.com/shashi/Escher.jl) aims to provide this. There is also [qmlweb](https://github.com/qmlweb/qmlweb), which attempts to bring QML to the browser, but I’m not sure how far along that is. I have never tried either of these, but I have seen some demos of Escher.jl and it looks very impressive.

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