Skip to content

Commit

Permalink
Add alias to Gtk::Widget#allocate using integers instead of a `Gdk:…
Browse files Browse the repository at this point in the history
…:Rectangle`.
  • Loading branch information
hugopl committed Jul 25, 2024
1 parent 4bfe2d2 commit bbc36af
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/bindings/gtk/widget.cr
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ module Gtk
GObject::Object.new(ptr, GICrystal::Transfer::None)
end

# :ditto:
def size_allocate(x : Int32, y : Int32, width : Int32, height : Int32, baseline : Int32)
size_allocate(Gdk::Rectangle.new(x, y, width, height), baseline)
end

# Returns an `Iterator` over widget children. Call `.to_a` on it if you need to allocate an
# array with all children.
#
Expand Down

0 comments on commit bbc36af

Please sign in to comment.