Julia GUI programming. What bindings are there ?

Hi there,

i am running Julia on Linux and want to build a GUI with TK.
For this i have downloaded the bindings from github. file TK.jl-master
Where to copy this folder in ?
Julia cannot find TK until i copy it in the right folder. suppose the Julia folder in linux.
How to build TK in Julia then.

In general i want to ask what kind of GUI libraries Julia has actually ?

Thank you for help

WBR
MHE

Manual package management (downloading from github and place into the correct folder) should not be needed. Actually you should be able to use the Pkg.add commands from the julia REPL. So in this case Pkg.add(‘Tk’) should download and install (and build) the package.
I don’t have the full overview, but Gtk is available and there is some work on using Qt. Maybe you look into https://pkg.julialang.org/ for available packages.

You could look into https://github.com/svaksha/Julia.jl/blob/master/Utilities.md#gui too.

QML (i.e. the “modern” Qt way, using a javascript-like language for the GUI layout itself) is supported through QML.jl and it should be mature enough to build a proper GUI quite painlessly. Some of the interfacing with Julia may change in the future though, to use Observables.jl.

oh. thats a cool function.

i have made

  1. Pkg.add(“Distributions”)
  2. Pkg.add(“Tk”)

and have now installed all.

Then i have started the following Julia GUI script:

using Base.Graphics
using Cairo
using Tk

win = Toplevel("Test" , 400, 200)
c = canvas(win)
pack(c, expand=true, fill="both")
# sleep(20)

The compilingtime take long.
Then a message appeared : Warning: could not import Base.Text into Tk

The Tk Window appeared only for 1 second and goes away.

Does anyone have an idea about that warning message and why the Tk window appears only so short time ?

WBR
MHE

Hi barche ,

really interesting that QML.
Please let me go to the point of a definite Tk code example first.

I made Pkg.update() and Pkg(“Tk”) first of course.

Example 1 code for Tk :slight_smile:


using Tk
Messagebox(title=“title” , message=“message”)


The code works.
Message - Warning could not import Base.Text into Tk
###########################################

Example 2 code for Tk:


using Base.Graphics
using Cairo
using Tk

win = Toplevel(“Test” , 400, 200)
c = Canvas(win)
pack(c, expand=true, fill=“both”)

#sleep(20)


Compiling takes a longer time.
Message appear such the above code ! Could not import Base.text.
And the Tk Window only appears for 1 seconds and flows away.
How to fix that in the code.
I want to make a Main Window that stays right long on screen.

WBR
MHE

Anon, I am not sure why you are insisting on using Tk. I guess you have existing skills there.

Have a look at the very last example on this page.
https://github.com/JuliaImages/ImageView.jl

I think you need to set up a Condition and keep the window open until the signal for window destroy is received.