from guietta import R1, R2, C, P try: from PySide2.QtWidgets import QDial, QLCDNumber, QTableWidget from PySide2.QtWidgets import QTableWidgetItem, QHeaderView except ImportError: from PyQt5.QtWidgets import QDial, QLCDNumber, QTableWidget from PyQt5.QtWidgets import QTableWidgetItem, QHeaderView gui = Gui( ['<center>A big GUI with all of Guietta' 's widgets</center>'], ['<center>Move the dial!</center>'], [HSeparator], ['Label', 'imagelabel.jpeg', L('another label'), VS('slider1')], [_, ['button'], B('another button'), III], ['__edit__', E('an edit box'), _, VSeparator], [R1('rad1'), R1('rad2'), R1('rad3'), III], [R2('rad4'), R2('rad5'), R2('rad6'), III], [C('ck1'), C('ck2'), C('ck3'), III], [Quit, Ok, Cancel, III], [Yes, No, _, III], [HS('slider2'), ___, ___, _], [(QDial, 'dial'), (QLCDNumber, 'lcd'), ___, _], [(QTableWidget, 'tab1'), ___, ___, ___], [III, III, III, III], [III, III, III, III], [P('progbar'), (QLCDNumber, 'lcd2'), _, _], [L('l1'), L('l2'), L('l3'), L('l4')],
from guietta import Gui, B, E, L, HS, VS, HSeparator, VSeparator from guietta import Yes, No, Ok, Cancel, Quit, _, ___, III from guietta import R1, R2, C, P from PySide2.QtWidgets import QDial, QLCDNumber, QTableWidget from PySide2.QtWidgets import QTableWidgetItem, QHeaderView gui = Gui( [ '<center>A big GUI with all of Guietta''s widgets</center>'], [ '<center>Move the dial!</center>'], [ HSeparator ], [ 'Label' , 'imagelabel.jpeg' , L('another label') , VS('slider1')], [ _ , ['button'] , B('another button') , III ], [ '__edit__' , E('an edit box') , _ , VSeparator ], [ R1('rad1') , R1('rad2') , R1('rad3') , III ], [ R2('rad4') , R2('rad5') , R2('rad6') , III ], [ C('ck1') , C('ck2') , C('ck3') , III ], [ Quit , Ok , Cancel , III ], [ Yes , No , _ , III ], [ HS('slider2'), ___ , ___ , _ ], [ (QDial, 'dial'), (QLCDNumber, 'lcd') , ___ , _ ], [ (QTableWidget, 'tab1'), ___ , ___ , ___ ], [ III , III , III , III ], [ III , III , III , III ], [P('progbar'), (QLCDNumber, 'lcd2') , _ , _ ], [ L('l1'), L('l2'), L('l3'), L('l4') ], )
# -*- coding: utf-8 -*- import os.path from guietta import B, L, _, Gui, Quit gui = Gui( [ 'Enter expression:', '__expr__' , B('right.png', 'newname') ], [ L('left.png', 'result') , 'result' , _ ], [ _ , _ , Quit ], images_dir = os.path.dirname(__file__) ) while True: name, event = gui.get() print(name, event) if name == 'newname': try: gui.result = eval(gui.expr) except Exception as e: gui.result = 'Error: ' + str(e) elif name == None: break
# -*- coding: utf-8 -*- from guietta import Gui, B, E, L, HS, VS, HSeparator, VSeparator from guietta import Yes, No, Ok, Cancel, Quit, _, ___, III gui = Gui(['<center>A big GUI with all of Guietta' 's widgets</center>'], [HSeparator], ['Label', 'imagelabel.jpeg', L('another label'), VS('slider1')], [_, ['button'], B('another button'), III], ['__edit__', E('an edit box'), _, VSeparator], [Quit, Ok, Cancel, III], [Yes, No, _, III], [HSeparator], [HS('slider2'), ___, ___, _]) dummy = gui.get()
# -*- coding: utf-8 -*- import os.path from guietta import B, L, _, Gui gui = Gui([_, L('up.png'), _], [B('left.png'), _, B('right.png')], [ _, L('down.png'), _, ], images_dir=os.path.dirname(__file__)) while True: name, event = gui.get() print(name, event) if name == None: break