def __init__(self, parent=None): super(UIController, self).__init__(parent) self.setWindowFlags(Qt.FramelessWindowHint) self.tw = TWController() self.tw.AuthInst.authorize_user() self.ui = widget() self.ui.setupUi(self) self.desktop = QDesktopWidget() self.framesize = self.frameSize() self.connect_signal_slot() self.updated_text() self.ui.UserInformation.setText(self.tw.AuthInst.UserName + " (@" + self.tw.AuthInst.UserID + ")") # self.ui.profileimg = QImage(self.tw.get_user_image()) # self.ui.label.setPixmap(QPixmap.fromImage(self.ui.profileimg)) self.animation = QPropertyAnimation(self, b'pos', self) self.move( QPoint(self.desktop.width() + 10, self.desktop.height() - 900)) self.setWindowFlag(Qt.WindowStaysOnTopHint) self.active = False self.change_interface_state() keyboard.add_hotkey(self.user_hotkey, lambda: self.change_interface_state()) # keyboard.add_hotkey('command+o', lambda: self.change_interface_state) # print(keyboard.read_hotkey()) print("UIController : CONSTRUCTOR PROCESS COMPLETE")
import pygame from pygame.locals import * import widget pygame.init() s=pygame.display.set_mode((640,480)) w=widget.widget(None,(0,0)) w.setSize((640,480)) w.show() v=widget.widget(w,(32,24)) v.setSize((100,100)) v.setColor((255,255,255)) w.show() qc=False while(not qc): events=pygame.event.get() for event in events: if(event.type==QUIT): qc=True if(event.type in [MOUSEMOTION,MOUSEBUTTONUP,MOUSEBUTTONDOWN]): p=event.pos r=w.screenRect() if(r.collidepoint(p)): w.mouseEvent(event) if(event.type in [KEYDOWN,KEYUP]): """ only one toplevel widget """ w.keyboardEvent(event) w.draw(s) pygame.display.flip()
def setUp(self): self.widget = widget()
# Просто файл для запуску програми. from threading import Thread from audio_freq import audio_freq from widget import widget # audio_freq() запускається в окремому потоці щоб файл freqs.txt постійно оновлювався. audio_freq_thrd = Thread(target=audio_freq) audio_freq_thrd.daemon = True audio_freq_thrd.start() widget()
import signal import threading APPINDICATOR_ID = 'CUDA-Indicator' from widget import widget import checks REFRESH_TIME = 1 WARNING_CHECK_FLAG = 1 WARNING_REFRESH_TIME = 5 WARNING_TEMPERATURE = 65 WARNING_UTILIZATION = 90 if __name__ == "__main__": if WARNING_CHECK_FLAG == 1: checks.all_checks(APPINDICATOR_ID, WARNING_CHECK_FLAG, WARNING_REFRESH_TIME, WARNING_TEMPERATURE, WARNING_UTILIZATION) signal.signal(signal.SIGINT, signal.SIG_DFL) widget(APPINDICATOR_ID, REFRESH_TIME)
import signal APPINDICATOR_ID = 'CUDA-Indicator' from widget import widget if __name__ == "__main__": signal.signal(signal.SIGINT, signal.SIG_DFL) widget(APPINDICATOR_ID)