Skip to content

clean up design #35

@JeffBezanson

Description

@JeffBezanson

We need to rethink our GUI API.

As a small example, the Tk package currently has types TkWidget, Tk_Widget, TTk_Widget, Canvas, TkCanvas, and Tk_CairoCanvas. I know there are reasons for these, but this is not going to work from a usability perspective.

In the work I started in tkwidget.jl, I was not really trying to provide "Tk bindings". This goes against the usual way scripting languages wrap libraries, which is to provide the same API as the original library, just callable from the scripting language. The usual approach does have advantages: (1) all functionality is exposed, (2) you can refer to existing documentation for the library, (3) people who already know the library have a shallow learning curve. This is the direction that @jverzani took things, and I greatly appreciate that work since it brought us a lot of functionality, and we will probably keep most of it.

But I would also like something else, which is a set of simple julian abstractions that would be directly meaningful to our users. Examples might include Window, Canvas, DrawingWindow, PlotWindow, Canvas3D, etc. (not all of those exist yet). It is possible this should be a new package, e.g. "GUI.jl", which can be implemented on top of Tk.jl and/or Gtk.jl. Then all my non-idiomatic-tk stuff in tkwidget.jl can be removed and the design will be less split. Or we could change Tk.jl and Gtk.jl to provide the desired API directly.

The first approach is probably more typical. But personally, I value simplicity more than features and low-level control, and the higher-level "toy" API is the only one I'd want to use. It might be nice to preserve the ability to write Tk- or Gtk- specific code, but that also risks fragmentation, e.g. people writing GUI widgets that only work with one library. So I want to start talking about how we should move forward. cc @timholy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions