GUI toolkits for Julia: Gtk vs Tk vs others

1,682 views
Skip to first unread message

Daniel Carrera

unread,
Mar 27, 2016, 8:09:51 PM3/27/16
to julia-users
Hello,

When it comes to GUI toolkits in Julia, Gtk seems to be the main choice, followed by Tk. At least in terms of development effort:

Gtk.jl -- 444 commits, 23 contributors
Tk.jl -- 235 commits, 28 contributors
PySide.jl -- 35 commits, 2 contributors


Although I like Gtk, I'm curious. Is there a reason Gtk gets more attention? Maybe Tk is just easier to support, so it doesn't need as many commits. But Tk also has less documentation. So I do get the impression Gtk gets more attention. Why would Gtk or Tk be preferred in the context of Julia?

My understanding is that Gtk is great on Linux but doesn't work so well on Windows and Mac. Tk has historically been considered ugly ("looks like Motif") but my impression is that this was fixed long ago. Gtk has more widgets than Tk and I think also more inputs. Qt is supposed to be great on other platforms. Are C++ toolkits more difficult to support? Oh, there is no package for wxWidgets, and that's also a C++ toolkit. Maybe that's a factor? Or maybe people just like the look of Gtk.


Cheers,
Daniel.

Lewis Levin

unread,
Mar 27, 2016, 8:42:42 PM3/27/16
to julia-users
The Python doc for tk will provide some hints...

Uwe Fechner

unread,
Mar 28, 2016, 12:30:17 AM3/28/16
to julia-users
I would like to add:
QML.jl -- 33 commits, 2 contributors

The very first release was just tagged. Already useful for simple but beautiful GUI's.

C++ libraries need a C++ wrapper. Cxx.jl is still very difficult to install. An alternative, CxxWrap.jl is just becoming available.

Uwe 

Daniel Carrera

unread,
Mar 28, 2016, 2:24:47 AM3/28/16
to julia...@googlegroups.com
Hello Uwe,

If accessing C++ is so difficult, that probably explains the situation with Qt and wxWidgets. I'm glad there is work going into C++ wrappers.

Cheers,
Daniel.

Milan Bouchet-Valat

unread,
Mar 28, 2016, 5:58:00 AM3/28/16
to julia...@googlegroups.com
My experience of Tk is that it's not actively maintained, contains some
annoying bugs and is quite limited in many areas. For example, you
can't write GUIs in a UI designer like Glade or Qt Designer. So I
wouldn't recommend it to anybody writing new code (except maybe for
very simple cases, but then why not use a modern toolkit anyway?).


Regards

>
> Cheers,
> Daniel.

hustf

unread,
Mar 28, 2016, 7:17:53 AM3/28/16
to julia-users
A better indication of what to go for may be looking at the testable packages which depend on Gtk, Tk & etc. 

A lot of good work is put into Gtk, but the hours we spend on resolving issues (on Windows and OsX) are not so interesting. I think Gtk needs a base of users who at least reports issues (I have had some instances with crashes which were difficult to pinpoint and resolve, and so gave up without contributing with error reports. Bad behaviour. ). But the buck don't always stop within the Julia community. Gtk is used to its max in the image manipulator Gimp (I assume), but even there the windows managing is sub par in my personal windowized opinion.

Blink also has dependencies, but with Chrom(ium?). That's extremely well developed software with pretty limitless possibilities - especially if you know the technologies already. 

GLVisualize still has few users, but it's maturing fast and can potentially go very very far.

Tim Holy

unread,
Mar 28, 2016, 9:25:37 AM3/28/16
to julia...@googlegroups.com
Gtk.jl has a more sophisticated internal design and is sometimes 5x or so
faster for certain time-consuming rendering operations. For new code, I would
certainly recommend it over Tk.jl, and I am slowly migrating my older
visualization packages to it.

Best,
--Tim

Daniel Carrera

unread,
Mar 28, 2016, 10:38:16 PM3/28/16
to julia...@googlegroups.com
Hello,

I wish I knew more about GUI toolkits. Somehow I've never managed to find the time. In which way does Gtk have a more sophisticated internal design?

My understanding is that Gtk doesn't work so well on Mac and Windows. The screenshots on the Gtk website certainly make it look out of place on Mac. Anyway, I just tried to install Gtk.jl on my Macbook but I keep getting a weird timeout error with Cairo:


julia> Pkg.add("Cairo")
INFO: Cloning cache of Cairo from git://github.com/JuliaLang/Cairo.jl.git
fatal: unable to connect to github.com: github.com[0: 192.30.252.130]: errno=Operation timed out

ERROR: failed process: Process(`git clone -q --mirror git://github.com/JuliaLang/Cairo.jl.git /Users/daniel/.julia/v0.4/.cache/Cairo`, ProcessExited(128)) [128]


I will try again when I can find a different way to get online.


Cheers,
Daniel.

Tim Holy

unread,
Mar 28, 2016, 10:58:27 PM3/28/16
to julia...@googlegroups.com
On Monday, March 28, 2016 07:38:12 PM Daniel Carrera wrote:
> I wish I knew more about GUI toolkits. Somehow I've never managed to find
> the time. In which way does Gtk have a more sophisticated internal design?

Specifically, Gtk.jl has a more sophisticated internal design than Tk.jl.
(Meaning, I was referring to the julia code.) Among other things, it makes use
of introspection, see https://wiki.gnome.org/Projects/GObjectIntrospection, to
auto-generate a lot of code and therefore be quite comprehensive but also
fairly easy to keep up-to-date.

Not sure about your error, but it seems like a network problem. Cairo is used
by both Gtk and Tk, so you'd have to figure that one out anyway.

--Tim

Daniel Carrera

unread,
Mar 28, 2016, 11:06:29 PM3/28/16
to julia...@googlegroups.com
On 28 March 2016 at 19:58, Tim Holy <tim....@gmail.com> wrote:
Specifically, Gtk.jl has a more sophisticated internal design than Tk.jl.
(Meaning, I was referring to the julia code.) Among other things, it makes use
of introspection, see https://wiki.gnome.org/Projects/GObjectIntrospection, to
auto-generate a lot of code and therefore be quite comprehensive but also
fairly easy to keep up-to-date.

Ah, thanks.
 
Not sure about your error, but it seems like a network problem. Cairo is used
by both Gtk and Tk, so you'd have to figure that one out anyway.

I am behind a proxy right now, and I know that they block some things. They might be blocking ports or something. I will be out of the proxy in a few days.

Cheers,
Daniel
Reply all
Reply to author
Forward
0 new messages