Gtk.jl icon indicating copy to clipboard operation
Gtk.jl copied to clipboard

Please add wrapper for the function set_keep_above

Open ufechner7 opened this issue 3 years ago • 4 comments

The following works, but it is wrong because I omitted the gbool parameter. See: https://docs.gtk.org/gtk3/method.Window.set_keep_above.html

using Gtk.ShortNames

function set_keep_above(win::Gtk.GtkWindow, setting::Bool)
    # gtk_window_set_keep_above(GTK_WINDOW(window), TRUE)
    ccall((:gtk_window_set_keep_above, Gtk.libgtk), Nothing, (Ptr{GObject},), win)
end

On my PCs I need to call it, if I don't the window appears in the background (well, if opened a second time).

ufechner7 avatar Aug 14 '22 12:08 ufechner7

julia> using Gtk.ShortNames

julia> G_.keep_above
keep_above (generic function with 1 method)

In short: all methods having a get or a set in the name are captured by the GAccessor module.

tknopp avatar Aug 14 '22 12:08 tknopp

And yes, the situation is not ideal. See https://github.com/JuliaGtk/Gtk4.jl/issues/6 for discussions on future directions.

tknopp avatar Aug 14 '22 12:08 tknopp

So I guess the only issue is lack of documentation?

ufechner7 avatar Aug 14 '22 12:08 ufechner7

Yes it seems so. In most cases one can use properties instead, which are documented https://juliagraphics.github.io/Gtk.jl/latest/manual/properties/
But not all getters/setters have properties and thus GAccessor is sometimes needed.

tknopp avatar Aug 14 '22 12:08 tknopp