Does there exist a comprehensive manual for an overview of the functions and features provided in Gtk.jl?

I am looking at examples of code developing UIs with Gtk.jl, but occasionally (if not frequently) encounter functions that I do not know what they actually do. If I run the examples, I can then piece together what I believe they do but wonder if there is a documentation list for the Gtk.jl api somewhere. Eg, in https://juliagraphics.github.io/Gtk.jl/latest/manual/async.html#Asynchronous-UI-1 there is the use of @Gtk.sigatom but I cannot see it described or even mentioned elsewhere in the manual. Is there a comprehensive list of the functionality provided by Gtk.jl?

In the terminal help I do not see much of a description:

help?> @Gtk.sigatom
  No documentation found.

  Gtk.GLib.@sigatom is a macro.

  # 1 method for macro "@sigatom":
  [1] @sigatom(__source__::LineNumberNode, __module__::Module, f) in Gtk.GLib at /home/xel/.julia/packages/Gtk/aP55V/src/GLib/signals.jl:190

another example is with @Pixbuf and appears to be a key component, in examples from https://julia-users.narkive.com/lKyJ0OOH/understanding-how-to-display-an-image-and-change-pixels-in-real-time-fast where a segment showing that use:

...
julia> using Gtk.ShortNames

julia> win = @Window("Test", 800, 600);

julia> data = Gtk.RGB[Gtk.RGB(div(255*x,800),div(255*y,600),0) for x=0:800,
y=0:600];

julia> pixbuf = @Pixbuf(data=data,has_alpha=false) # removing the has_alpha
parameter required variable is https://github.com/JuliaLang/Gtk.jl/issues/94

julia> view = @Image(pixbuf);
...
1 Like

I think the manual is all there is at the moment.

When I use Gtk.jl I usually have the github repo and the Gtk docs opened in my browser. I often find the function I want to call in Gtk doc (or by googling), and then search it in the repo to see how it’s been wrapped.

Gtk.jl got a few things that are not in Gtk (like @sigatom) but most of it is relatively straightforward bindings of the C library.

Looking at the tests can be helpful too.

I often find the function I want to call in Gtk doc
As an example I tried to search in the Gtk docs for the function set_gtk_property which is used in Gtk.jl but did not find it. How should I go about looking in those Gtk docs and translating that to Gtk.jl code?

The Gtk names are always in ccall's and start with gtk_, for example gtk_paned_get_child1 here. If you google that (or search it in Gtk.jl repo) you can find the correspondence between Gtk.jl and Gtk docs. With that you can figure out that pane[1] will return its first child ([] calls getindex).

set_gtk_property is a Gtk.jl function. Note that you can use window.title[String] instead of get_gtk_property(window, :title, String) and window.title[String] = "test" instead of set_gtk_property!(window, :title, "test").

2 Likes

Although this is true - I have to admit - it is very laborious to do this. I wonder how hard it would be to autogenerate a table of the functions available in gtk.jl and what they wrap via parsing? Dunno, but using Gtk.jl is not exactly a smooth experience unless you want to do explicitly whats in the docs.

For example: even @Pixbuf mentioned earlier is no longer a function?

I think as I go along I may contribute some more examples.

One issue of Gtk.jl is that only few people are working on it.

2 Likes

I’ve realized that Plots, Gtk, and a few others, despite being widely used are maintained by very few people. So I’ve been trying to raise interest/awareness to these areas, and hopefully will be able to contribute a little to both.

2 Likes

The situation is ok, i think, but the experience could be much better. What we lack is a Gtk dev interested in Julia :slightly_smiling_face:

1 Like

Well a Gtk dev I am not, but able to lend a hand here and there I can do :). For example Plots.jl has >500 open issues on it’s repo, and Gtk.jl has a completely undocumented API. So I think I’m going to help there when I can

2 Likes

That would be very much appreciated!