parent
70319eea61
commit
3baa3203c0
|
|
@ -0,0 +1,63 @@
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from PySide6.QtCore import Qt
|
||||||
|
from PySide6.QtWidgets import (
|
||||||
|
QApplication,
|
||||||
|
QHBoxLayout,
|
||||||
|
QLabel,
|
||||||
|
QMainWindow,
|
||||||
|
QPushButton,
|
||||||
|
QStackedLayout,
|
||||||
|
QVBoxLayout,
|
||||||
|
QWidget,
|
||||||
|
)
|
||||||
|
|
||||||
|
from layout_colorwidget import Color
|
||||||
|
|
||||||
|
|
||||||
|
class MainWindow(QMainWindow):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
|
self.setWindowTitle("My App")
|
||||||
|
|
||||||
|
pagelayout = QVBoxLayout()
|
||||||
|
button_layout = QHBoxLayout()
|
||||||
|
self.stacklayout = QStackedLayout()
|
||||||
|
|
||||||
|
pagelayout.addLayout(button_layout)
|
||||||
|
pagelayout.addLayout(self.stacklayout)
|
||||||
|
|
||||||
|
btn = QPushButton("red")
|
||||||
|
btn.pressed.connect(self.activate_tab_1)
|
||||||
|
button_layout.addWidget(btn)
|
||||||
|
self.stacklayout.addWidget(Color("red"))
|
||||||
|
|
||||||
|
btn = QPushButton("green")
|
||||||
|
btn.pressed.connect(self.activate_tab_2)
|
||||||
|
button_layout.addWidget(btn)
|
||||||
|
self.stacklayout.addWidget(Color("green"))
|
||||||
|
|
||||||
|
btn = QPushButton("yellow")
|
||||||
|
btn.pressed.connect(self.activate_tab_3)
|
||||||
|
button_layout.addWidget(btn)
|
||||||
|
self.stacklayout.addWidget(Color("yellow"))
|
||||||
|
|
||||||
|
widget = QWidget()
|
||||||
|
widget.setLayout(pagelayout)
|
||||||
|
self.setCentralWidget(widget)
|
||||||
|
|
||||||
|
def activate_tab_1(self):
|
||||||
|
self.stacklayout.setCurrentIndex(0)
|
||||||
|
|
||||||
|
def activate_tab_2(self):
|
||||||
|
self.stacklayout.setCurrentIndex(1)
|
||||||
|
|
||||||
|
def activate_tab_3(self):
|
||||||
|
self.stacklayout.setCurrentIndex(2)
|
||||||
|
|
||||||
|
|
||||||
|
app = QApplication(sys.argv)
|
||||||
|
window = MainWindow()
|
||||||
|
window.show()
|
||||||
|
app.exec()
|
||||||
Binary file not shown.
|
|
@ -13,7 +13,8 @@ Config.set('graphics', 'width', '480')
|
||||||
Config.set('graphics', 'height', '320')
|
Config.set('graphics', 'height', '320')
|
||||||
Config.set('graphics', 'show_cursor', '0')
|
Config.set('graphics', 'show_cursor', '0')
|
||||||
|
|
||||||
SERVER_MAC = '8C:E9:EE:C9:33:4D'
|
# SERVER_MAC = '8C:E9:EE:C9:33:4D'
|
||||||
|
SERVER_MAC = '00:72:EE:DE:15:79'
|
||||||
PORT = 5
|
PORT = 5
|
||||||
|
|
||||||
from kivy.app import App
|
from kivy.app import App
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue