Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Please add wrapper for the function set_keep_above #660

Open
ufechner7 opened this issue Aug 14, 2022 · 4 comments
Open

Please add wrapper for the function set_keep_above #660

ufechner7 opened this issue Aug 14, 2022 · 4 comments

Comments

@ufechner7
Copy link
Member

ufechner7 commented Aug 14, 2022

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).

@tknopp
Copy link
Collaborator

tknopp commented Aug 14, 2022

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
Copy link
Collaborator

tknopp commented Aug 14, 2022

And yes, the situation is not ideal. See JuliaGtk/Gtk4.jl#6 for discussions on future directions.

@ufechner7
Copy link
Member Author

So I guess the only issue is lack of documentation?

@tknopp
Copy link
Collaborator

tknopp commented Aug 14, 2022

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants