#!/usr/bin/env python3
-from sys import argv, exit
+from sys import argv, stderr, exit
try:
from PyQt6.QtGui import QIcon
from PyQt6.QtCore import *
from PyQt6.QtWidgets import *
+ print("Running on PyQt6", file=stderr)
except:
try:
# apt-get install python3-pyqt5
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
+ print("Running on PyQt5", file=stderr)
except:
from PyQt4.QtGui import QIcon
from PyQt4.QtCore import *
from PyQt4.QtWidgets import *
+ print("Running on PyQt4", file=stderr)
from gamiki import Builder, Library
from gamiki.qt.utils import start
if __name__ == '__main__':
app = QApplication(argv)
- game1 = Game(None, PurePath(""))
- game1["Name"] = "Super Sheep"
- game1["Icon"] = "./super-sheep.jpg"
- game1._init()
- game2 = Game(None, PurePath(""))
- game2["Name"] = "Super Buba II: le retour de la nouvelle bĂȘte"
- game2["Icon"] = "./buba.jpg"
- game2._init()
- game3 = Game(None, PurePath(""))
- game3["Name"] = "Fluffy"
- game3["Icon"] = "./fluffy.jpg"
- game3._init()
+ game1 = Game(None, PurePath("Super Sheep"))
+ game1.icon = PurePath("./super-sheep.jpg")
+ game2 = Game(None, PurePath("Super Buba II: le retour de la nouvelle bĂȘte"))
+ game2.icon = PurePath("./buba.jpg")
+ game3 = Game(None, PurePath("Fluffy"))
+ game3.icon = PurePath("./fluffy.jpg")
#game_widget1 = ListItem(game1) ; game_widget1.show()
#game_widget2 = GridItem(game3) ; game_widget2.show()
list1 = List([ game1, game2, game3 ]) ; list1.show()
grid = Grid([ game1, game2, game3 ]) ; grid.show()
- list1.onClick.connect(lambda game: print("LIST:", game))
- grid.onClick.connect(lambda game: print("GRID:", game))
+ list1.onClick.connect(lambda game: print("LIST:", game.name))
+ grid.onClick.connect(lambda game: print("GRID:", game.name))
exit(app.exec_())