Skip to content

Commit

Permalink
add a few methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jwahlstrand committed Nov 25, 2023
1 parent 1e51124 commit 239db6e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ Related GTK function: [`gtk_widget_grab_focus`()]($(gtkdoc_method_url("gtk4","Wi
"""
grab_focus(w::GtkWidget) = G_.grab_focus(w)

"""
isrealized(w::GtkWidget)
Returns whether `w` is realized (that is, whether it has been associated with
a drawing surface).
"""
isrealized(w::GtkWidget) = G_.get_realized(w)

"""
activate(w::GtkWidget)
Expand Down
2 changes: 2 additions & 0 deletions src/events.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ function GtkShortcutController(widget::GtkWidget)
g
end

push!(sc::GtkShortcutController, s::GtkShortcut) = (G_.add_shortcut(sc,s);sc)

function GtkGestureClick(widget::GtkWidget,button=1)
g = G_.GestureClick_new()
button != 1 && G_.set_button(g, button)
Expand Down
8 changes: 8 additions & 0 deletions src/windows.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ Related GTK function: [`gtk_window_default_size`()]($(gtkdoc_method_url("gtk4","
"""
default_size(win::GtkWindow, w, h) = G_.set_default_size(win, w, h)

"""
isactive(win::GtkWindow)
Returns whether `win` is the currently active toplevel. This is the window that
receives keystrokes.
"""
isactive(win::GtkWindow) = G_.is_active(win)

"""
destroy(win::GtkWindow)
Expand Down

0 comments on commit 239db6e

Please sign in to comment.