init: начало работы над приложением с использованием wxPython
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import sys
|
||||
|
||||
import wx
|
||||
|
||||
from mind_reader.ui.main_frame import MainFrame
|
||||
|
||||
|
||||
def enable_high_dpi_support():
|
||||
if sys.platform == "win32":
|
||||
try:
|
||||
import ctypes
|
||||
|
||||
ctypes.windll.shcore.SetProcessDpiAwareness(2)
|
||||
except Exception:
|
||||
try:
|
||||
import ctypes
|
||||
|
||||
ctypes.windll.user32.SetProcessDPIAware()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
class MindReaderApp(wx.App):
|
||||
def OnInit(self) -> bool:
|
||||
self.frame = MainFrame()
|
||||
self.frame.Show(True)
|
||||
self.SetTopWindow(self.frame)
|
||||
return True
|
||||
|
||||
|
||||
def main():
|
||||
enable_high_dpi_support()
|
||||
|
||||
app = MindReaderApp(redirect=False)
|
||||
app.MainLoop()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user