Skip to content

Commit

Permalink
Merge pull request #313 from PhiCross5/master
Browse files Browse the repository at this point in the history
Fix Box hierarchy for GTK4
  • Loading branch information
psychon authored Aug 27, 2023
2 parents 9757379 + 9020ed2 commit e929060
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lgi/override/Gtk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ if Gtk.Container then
end
end


-------------------------------- Gtk.Builder overrides.
Gtk.Builder._attribute = {}

Expand Down Expand Up @@ -631,6 +632,25 @@ Gtk._constant.PRINT_OUTPUT_URI = 'output-uri'
-- Gtk-cairo integration helpers.
cairo.Context._method.should_draw_window = Gtk.cairo_should_draw_window

-------------------------------- Gtk-4 overrides


if Gtk._version == '4.0' then

--- CONTAINER CLASSES
--- GTK4 Has removed the Container abstract class.
--- This means Boxes, Grids and other layout widgets
--- Must now add children using their own specific methods.

--- Gtk.Box overrides

--- widgets on a the array part of the constructor of a Box
--- will be `append()`-ed
--- in order of appearance.
Gtk.Box._container_add = Gtk.Box.append

end

--------------------------------- Gtk-2 workarounds
if Gtk._version == '2.0' then
-- Get rid of Gtk.Bin internal 'child' field, which gets in the way
Expand Down

0 comments on commit e929060

Please sign in to comment.