Skip to content

Commit

Permalink
Specify more library versions in sample code (#298)
Browse files Browse the repository at this point in the history
This is needed for systems that support both GTK 3 and GTK 4, otherwise,
'require' may try to pull in GTK 4, or other mutually incompatible
library versions.
  • Loading branch information
leaf-node authored Jul 30, 2022
1 parent 3f47eb5 commit 536bc4c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion samples/console.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local Gio = lgi.Gio
local Gtk = lgi.require('Gtk', '3.0')
local Gdk = lgi.require('Gdk', '3.0')
local Pango = lgi.Pango
local GtkSource = lgi.GtkSource
local GtkSource = lgi.require('GtkSource', '3.0')

-- Creates new console instance.
local function Console()
Expand Down
2 changes: 1 addition & 1 deletion samples/goocanvas.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local lgi = require 'lgi'
local Gtk = lgi.Gtk
local Gtk = lgi.require('Gtk', '3.0')
local Goo = lgi.GooCanvas

local window = Gtk.Window {
Expand Down
4 changes: 2 additions & 2 deletions samples/gstvideo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

local lgi = require 'lgi'
local GLib = lgi.GLib
local Gtk = lgi.Gtk
local GdkX11 = lgi.GdkX11
local Gtk = lgi.require('Gtk', '3.0')
local GdkX11 = lgi.require('GdkX11', '3.0')
local Gst = lgi.Gst
if tonumber(Gst._version) >= 1.0 then
local GstVideo = lgi.GstVideo
Expand Down
2 changes: 1 addition & 1 deletion samples/gtk-demo/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ local Gio = lgi.Gio
local Gtk = lgi.require('Gtk', '3.0')
local Pango = lgi.Pango
local GdkPixbuf = lgi.GdkPixbuf
local GtkSource = lgi.GtkSource
local GtkSource = lgi.require('GtkSource', '3.0')

-- Create package for the whole demo.
local GtkDemo = lgi.package 'GtkDemo'
Expand Down
2 changes: 1 addition & 1 deletion samples/gtkhello.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
--

local lgi = require 'lgi'
local Gtk = lgi.require('Gtk')
local Gtk = lgi.require('Gtk', '3.0')

-- Create top level window with some properties and connect its 'destroy'
-- signal to the event loop termination.
Expand Down

0 comments on commit 536bc4c

Please sign in to comment.