Skip to content

Commit

Permalink
Update to GTK4
Browse files Browse the repository at this point in the history
  • Loading branch information
zevlee committed May 21, 2022
1 parent 2b212f0 commit cf3106d
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 7 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.4
0.2.0
7 changes: 4 additions & 3 deletions lib/application.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env python3

from gi import require_version
require_version("Gtk", "3.0")
from gi.repository import Gtk
require_version("Gtk", "4.0")
require_version("Adw", "1")
from gi.repository import Gtk, Adw


class AppWindow(Gtk.ApplicationWindow):
Expand All @@ -12,7 +13,7 @@ def __init__(self, app):
self.set_title("Hello World")


class Application(Gtk.Application):
class Application(Adw.Application):

def __init__(self):
super().__init__()
Expand Down
7 changes: 7 additions & 0 deletions linux/hello-world-gtk.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ a = Analysis(
('../VERSION', '.'),
('hello-world-gtk.desktop', '.')
],
hooksconfig={
"gi": {
"module-versions": {
"Gtk": "4.0"
}
}
},
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
Expand Down
2 changes: 1 addition & 1 deletion macos/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh

brew install pygobject3 gtk+3 adwaita-icon-theme
brew install pygobject3 gtk4 adwaita-icon-theme libadwaita

echo "Done"
7 changes: 7 additions & 0 deletions macos/hello-world-gtk.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ a = Analysis(
('../LICENSE', '.'),
('../VERSION', '.')
],
hooksconfig={
"gi": {
"module-versions": {
"Gtk": "4.0"
}
}
},
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pyinstaller
git+https://github.com/pyinstaller/pyinstaller.git
2 changes: 1 addition & 1 deletion windows/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

# This script is meant to be run through MinGW

pacman -S --noconfirm mingw-w64-x86_64-gtk3 mingw-w64-x86_64-python-pip mingw-w64-x86_64-python3-gobject mingw-w64-x86_64-nsis mingw-w64-x86_64-nsis-nsisunz zip unzip
pacman -S --noconfirm mingw-w64-x86_64-gtk4 mingw-w64-x86_64-python-pip mingw-w64-x86_64-python3-gobject mingw-w64-x86_64-libadwaita mingw-w64-x86_64-nsis mingw-w64-x86_64-nsis-nsisunz zip unzip

echo "Done"
7 changes: 7 additions & 0 deletions windows/hello-world-gtk.spec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ a = Analysis(
('../LICENSE', '.'),
('../VERSION', '.')
],
hooksconfig={
"gi": {
"module-versions": {
"Gtk": "4.0"
}
}
},
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
Expand Down

0 comments on commit cf3106d

Please sign in to comment.