Skip to content
Browse files

Gtk: make Gtk-2.0.typelib usable again

  • Loading branch information...
1 parent 15b3c0d commit 90aa6c8491db0b2587ca094802a594bf5834fb7e @pavouk committed
Showing with 7 additions and 3 deletions.
  1. +2 −1 lgi/override/Gtk.lua
  2. +5 −2 samples/gtkhello.lua
View
3 lgi/override/Gtk.lua
@@ -573,7 +573,8 @@ end
-- Workaround for bug in GTK+; text_column accessors don't do an extra
-- needed work which is done properly in
-- gtk_entry_completion_{set/get}_text_column
-if Gtk.get_major_version() == 3 and Gtk.get_minor_version() < 4 then
+if Gtk._version == '2.0' or (Gtk.get_major_version() == 3 and
+ Gtk.get_minor_version() < 4) then
Gtk.EntryCompletion._attribute = {
text_column = { get = Gtk.EntryCompletion.get_text_column,
set = Gtk.EntryCompletion.set_text_column }
View
7 samples/gtkhello.lua
@@ -7,7 +7,7 @@
--
local lgi = require 'lgi'
-local Gtk = lgi.Gtk
+local Gtk = lgi.require('Gtk')
-- Create top level window with some properties and connect its 'destroy'
-- signal to the event loop termination.
@@ -15,10 +15,13 @@ local window = Gtk.Window {
title = 'window',
default_width = 400,
default_height = 300,
- has_resize_grip = true,
on_destroy = Gtk.main_quit
}
+if tonumber(Gtk._version) >= 3 then
+ window.has_resize_grip = true
+end
+
-- Create some more widgets for the window.
local status_bar = Gtk.Statusbar()
local toolbar = Gtk.Toolbar()

0 comments on commit 90aa6c8

Please sign in to comment.
Something went wrong with that request. Please try again.