# How to design GUI interfaces in Julia?

**URL:** <https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159>\
**Category:** General Usage\
**Tags:** gui\
**Created:** [December 24, 2024, 8:33pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159 "2024-12-24T20:33:58Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [December 31, 2024, 11:49am UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/41 "2024-12-31T11:49:53Z")

</div>

I am currently working on a Julia API to SLINT ([https://slint.dev/](https://slint.dev/)) which is a GUI library for Rust.

> **[GitHub - oheil/Slint.jl: Slint GUI for Julia](https://github.com/oheil/Slint.jl)**
>
> Slint GUI for Julia

For me it started as fun project to learn Rust, but it turned out to be tedious. I actually need some help to get this on track… I think it needs some experienced Rust developer.

---

<div class="post-metadata">

**Author:** ![GeorgeGkountouras](https://avatars.discourse-cdn.com/v4/letter/g/77aa72/32.png) [@GeorgeGkountouras](https://discourse.julialang.org/u/GeorgeGkountouras)\
**Post date:** [December 31, 2024, 2:40pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/42 "2024-12-31T14:40:12Z")

</div>

> [@ufechner7](#):
>
> I thought that relocatability of system images was implemented in Julia 1.11, independant of the packages that you are using.

Individual packages may still do things that result in un-relocatable images. In my experience, it’s pretty hit-and-miss, depending on the package.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [December 31, 2024, 2:55pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/43 "2024-12-31T14:55:10Z")

</div>

> [@GeorgeGkountouras](#):
>
> Individual packages may still do things that result in un-relocatable images. In my experience, it’s pretty hit-and-miss, depending on the package.

So we need a tutorial that explains how to test and how to avoid un-relocatable images.

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [December 31, 2024, 6:04pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/44 "2024-12-31T18:04:41Z")

</div>

GLFW\_jll.jl currently requires \> 70 dependencies

If I understand [GLFW: Compiling GLFW](https://www.glfw.org/docs/3.3/compile.html#compile_deps_wayland)

> To compile GLFW for Wayland, you need to have the Wayland and xkbcommon development packages installed. They are not needed to build or run programs that use GLFW.

And yet for some reason:

```julia
(jl_Ht8Yzi) pkg> why Wayland_jll
  GLFW_jll → libdecor_jll → Wayland_jll
  GLFW_jll → libdecor_jll → xkbcommon_jll → Wayland_jll
  GLFW_jll → xkbcommon_jll → Wayland_jll

```

Even stranger is the dependency on XML2\_jll.jl XML2 is a bloated xml parsing library with over 100K lines of C code, for reference XML.jl is less than 1K lines of Julia.

```julia
(jl_Ht8Yzi) pkg> why XML2_jll
  GLFW_jll → Libglvnd_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → Libglvnd_jll → Xorg_libXext_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → Xorg_libXcursor_jll → Xorg_libXfixes_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → Xorg_libXcursor_jll → Xorg_libXrender_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → Xorg_libXi_jll → Xorg_libXext_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → Xorg_libXi_jll → Xorg_libXfixes_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → Xorg_libXinerama_jll → Xorg_libXext_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → Xorg_libXrandr_jll → Xorg_libXext_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → Xorg_libXrandr_jll → Xorg_libXrender_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → libdecor_jll → Libglvnd_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → libdecor_jll → Libglvnd_jll → Xorg_libXext_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → libdecor_jll → Pango_jll → Cairo_jll → Glib_jll → Gettext_jll → XML2_jll
  GLFW_jll → libdecor_jll → Pango_jll → Cairo_jll → Xorg_libXext_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → libdecor_jll → Pango_jll → Cairo_jll → Xorg_libXrender_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → libdecor_jll → Pango_jll → Glib_jll → Gettext_jll → XML2_jll
  GLFW_jll → libdecor_jll → Pango_jll → HarfBuzz_jll → Cairo_jll → Glib_jll → Gettext_jll → XML2_jll
  GLFW_jll → libdecor_jll → Pango_jll → HarfBuzz_jll → Cairo_jll → Xorg_libXext_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → libdecor_jll → Pango_jll → HarfBuzz_jll → Cairo_jll → Xorg_libXrender_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → libdecor_jll → Pango_jll → HarfBuzz_jll → Glib_jll → Gettext_jll → XML2_jll
  GLFW_jll → libdecor_jll → Wayland_jll → XML2_jll
  GLFW_jll → libdecor_jll → xkbcommon_jll → Wayland_jll → XML2_jll
  GLFW_jll → libdecor_jll → xkbcommon_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → libdecor_jll → xkbcommon_jll → Xorg_xkeyboard_config_jll → Xorg_xkbcomp_jll → Xorg_libxkbfile_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → xkbcommon_jll → Wayland_jll → XML2_jll
  GLFW_jll → xkbcommon_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll
  GLFW_jll → xkbcommon_jll → Xorg_xkeyboard_config_jll → Xorg_xkbcomp_jll → Xorg_libxkbfile_jll → Xorg_libX11_jll → Xorg_libxcb_jll → XSLT_jll → XML2_jll

```

---

<div class="post-metadata">

**Author:** ![Janis\_Erdmanis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/janis_erdmanis/32/10869_2.png) [@Janis\_Erdmanis](https://discourse.julialang.org/u/Janis_Erdmanis)\
**Post date:** [December 31, 2024, 6:30pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/45 "2024-12-31T18:30:47Z")

</div>

It may be worthwhile to explore whether an artifact overriding mechanism can be used to replace the `GLFW` library with one installed on the system. This would be a preferable approach to reducing the number of dependencies, as the current approach works well, eliminating as many assumptions about the host system as possible.

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [December 31, 2024, 6:43pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/46 "2024-12-31T18:43:29Z")

</div>

Hmm, is there a lowest common denominator host system (or set of host systems) I can test GLFW\_jll on to see if it is actually using all of its dependancies in a worst case scenario?

---

<div class="post-metadata">

**Author:** ![apo383](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/apo383/32/11272_2.png) [@apo383](https://discourse.julialang.org/u/apo383)\
**Post date:** [December 31, 2024, 11:09pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/47 "2024-12-31T23:09:33Z")

</div>

> [@joa-quim](#):
>
> See [mirone](https://github.com/joa-quim/mirone), not a small thing.

Mirone is a really impressive GUI app. I must have missed that version of Matlab compiler; in my memory there was always a huge runtime. In the case of 6.5, I suspect the small app size is leveraging some sort of Windows .NET framework or maybe even Java. I wonder if the packaged app is similarly small for Mac.

I agree it would be nice to have an easy way to custom package one’s own computational code into a single GUI app. It was kind of possible with Java, Visual Basic, etc. and almost there today with Python. I guess the key is still to leverage a runtime already on most people’s systems. Might get there soon by compiling into Javascript for a mobile web app.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [December 31, 2024, 11:58pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/48 "2024-12-31T23:58:39Z")

</div>

> [@apo383](#):
>
> I guess the key is still to leverage a runtime already on most people’s systems.

I don’t agree. I am very happy that Julia and many packages bring their own libraries. Only by doing this it is possible to run the same Julia program on many different operating systems and also on many different versions of the same OS. This is one reasons I switched to Julia: I have an old Python program, but it runs only using Python 2.7 on Ubuntu 12.04 because it depends on old system libraries. Never again!

---

<div class="post-metadata">

**Author:** ![apo383](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/apo383/32/11272_2.png) [@apo383](https://discourse.julialang.org/u/apo383)\
**Post date:** [January 1, 2025, 7:34pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/49 "2025-01-01T19:34:41Z")

</div>

> [@ufechner7](#):
>
> I don’t agree.

I’m just observing, not advocating. That’s great that you don’t mind libraries, neither do I. But I know a fair number of PhDs who cannot reliably install a CLI Python package from repo, get the dependencies sorted out, and have it running. If it’s a GUI app, say using PyQt, then you’re talking about some big downloads and possibly lengthy dependency resolution. I know only a handful of people who can install and run Julia and packages. The wider world of STEM (outside CS) is just not so computer savvy.

I do think it’s desirable for casual programmers to share apps that are small and one-clickable as @joa-quim seeks. My observation is that such apps are only small these days if there’s a largish runtime already tucked into your system. Which of course is what every OS, browser, JRE, JVM, etc. is doing to become a mainstream platform. I suspect Matlab 6.5 made good use of JRE to make the compiled app small.

Some may remember a brief period when Microsoft Visual Basic made it incredibly easy to write decent GUI apps. Real computations had to be deployed in a dll, but lots of simple stuff could be done in VB alone, with the runtime tucked into Windows. Then things got complicated with dll hell, and Microsoft pivoted to .NET to unify the runtimes but never regained that simplicity in VB or elsewhere.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [January 1, 2025, 7:56pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/50 "2025-01-01T19:56:37Z")

</div>

I managed to create a GUI application (standalone) in Julia for a simple task at my institute without problems using QML and PackageCompiler.jl. Of course, the macOS bundle is about 287 MB, but it is a single click operation to open and I hardly believe that this size matters for a desktop application today.

---

<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:** [January 1, 2025, 8:08pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/51 "2025-01-01T20:08:02Z")

</div>

At the time of Matlab 6.5 the .m the compiler was able to convert the .m code in C and compile it normally. The graphical interface (on Windows) was provided by Intel libraries. Together this is what made (and still does) it possible to create standalone packages like Mirone. Sure, it was not all roses (for example only doubles were allowed) and the whole thing was 32 bits only, but could be done.

---

<div class="post-metadata">

**Author:** ![Janis\_Erdmanis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/janis_erdmanis/32/10869_2.png) [@Janis\_Erdmanis](https://discourse.julialang.org/u/Janis_Erdmanis)\
**Post date:** [January 1, 2025, 8:45pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/52 "2025-01-01T20:45:26Z")

</div>

I suppose Windows was the only target in such a scenario. Nowadays, however, we want a cross-platform deployment without the developers becoming platform experts and library maintainers. Hence, the most reasonable choice is to ship all libraries and make as few assumptions about the system as possible, even if that means having X libraries while the app runs on Wayland.

If one wants to reduce the size of shipped applications, one can still do so, as I understand, with artifact overriding mechanism. Doing so may or may not work straightforwardly, and one may learn a lot about compilation pipelines, flags, patches and version differences.

For instance, Snap and MSIX package installers support installing shared libraries with specific versions separately. One can shave the resulting installer size by installing Julia runtime and the shared libraries separately. On the other hand, MacOS does not support that; hence, its installers need to ship everything.

---

<div class="post-metadata">

**Author:** ![apo383](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/apo383/32/11272_2.png) [@apo383](https://discourse.julialang.org/u/apo383)\
**Post date:** [January 1, 2025, 9:17pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/53 "2025-01-01T21:17:34Z")

</div>

> [@joa-quim](#):
>
> The graphical interface (on Windows) was provided by Intel libraries.

One reason I suspect Java is that around that time Matlab introduced Desktop, with entire GUI in Java. It was okay and cross-platform except for slow start-up and memory hogging. Microsoft and Apple used to deploy Java with OS, until they dropped it due to lawsuits and security issues, and Matlab eventually had to pivot away, which may be why later compiled apps couldn’t be small anymore. I also suspect that mirone looked the same on Windows and Mac (or at least not like Mac), which would be unlikely with native GUI calls. This is all hazy memory of course.

---

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [January 1, 2025, 9:47pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/54 "2025-01-01T21:47:15Z")

</div>

> [@Janis\_Erdmanis](#):
>
> It may be worthwhile to explore whether an artifact overriding mechanism can be used to replace the `GLFW` library with one installed on the system.

This is already possible, these should be the relevant docs: [Overriding artifact locations](https://pkgdocs.julialang.org/v1/artifacts/#Overriding-artifact-locations)

---

<div class="post-metadata">

**Author:** ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Post date:** [January 1, 2025, 10:00pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/55 "2025-01-01T22:00:28Z")

</div>

The registration workflow should catch that. If there is a badge for relocatability it would be great.

---

<div class="post-metadata">

**Author:** ![Janis\_Erdmanis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/janis_erdmanis/32/10869_2.png) [@Janis\_Erdmanis](https://discourse.julialang.org/u/Janis_Erdmanis)\
**Post date:** [January 1, 2025, 10:13pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/56 "2025-01-01T22:13:24Z")

</div>

Yes, that is the mechanism I meant. One needs to explore if application libraries are overrided with the host system-provided ones, would they still work. There may be pitfalls hidden in how libraries are compiled, linked, or patched, so I wouldn’t expect to be easy unless we are lucky.

---

<div class="post-metadata">

**Author:** ![Eben60](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eben60/32/13475_2.png) [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Post date:** [January 1, 2025, 10:35pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/57 "2025-01-01T22:35:09Z")

</div>

> [@apo383](#):
>
> I know only a handful of people who can install and run Julia and packages. The wider world of STEM (outside CS) is just not so computer savvy.

I live in that “wider world”, and though I agree many of the colleagues are not computer savvy, each of them would be able to install Julia via `juliaup` and one package according to provided instructions.

OK, the last time a guy ignored my advice to use `juliaup`, he downloaded Julia and then needed my help, but if you write “install Julia using `juliaup` according to…” in large enough letters 😁, most people would do it, and it works.

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [January 3, 2025, 10:22pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/58 "2025-01-03T22:22:34Z")

</div>

This `libdecor` issue for a “self-contained” plugin might also help.

> **[Add "self-contained" plugin with minimal dependencies (#36) · Issues ·...](https://gitlab.freedesktop.org/libdecor/libdecor/-/issues/36)**
>
> Several commerical games package their own, outdated builds of libraries required by the Cairo plugin (such has Pango, Harfbuzz, etc). Due to these older builds being preferentially loaded...

---

<div class="post-metadata">

**Author:** ![linwaytin](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@linwaytin](https://discourse.julialang.org/u/linwaytin)\
**Post date:** [January 4, 2025, 3:42pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/59 "2025-01-04T15:42:30Z")

</div>

I noticed that no one mentioned FLTK, so decided to give my 2 cents.

[FLTK](https://en.wikipedia.org/wiki/FLTK) is lightweight, cross-platform GUI lib written in C++. Its lightweight design is twofold: Not only the library size is small and can be statically linked, but also it does not use some “modern” C++ features, which means wrapping it in Julia should not be possible.

The main “problem” of this library is, arguably, the archaic design of the widgets, but I think this is not a big issue for most scientific computing software. On the other hand, although the project started long time ago, it is still under active development, and just released a new version which supports Wayland on Linux and HiDPI in different platforms.

Given it does not use advanced features of C++, calling it from C++ should be possible. Also, I found a C binding [https://github.com/MoAlyousef/cfltk](https://github.com/MoAlyousef/cfltk) which might be called directly from Julia. (The same author made a popular Rust binding for FLTK, based on this C binding.)

---

<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:** [January 4, 2025, 4:21pm UTC](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/60 "2025-01-04T16:21:21Z")

</div>

> [@linwaytin](#):
>
> Also, I found some a C binding [GitHub - MoAlyousef/cfltk: C Bindings for FLTK](https://github.com/MoAlyousef/cfltk), which might be called directly from Julia.

Nice discovery.

[Previous page](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159.md?page=2)

[Next page](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159.md?page=4)
