Кнопка "Настройки" теперь кликабельна.
Код почищен
This commit is contained in:
15
main.py
15
main.py
@@ -1,6 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import wx
|
||||
|
||||
|
||||
class MainFramePanel(wx.Panel):
|
||||
def __init__(self, parent):
|
||||
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.Size(500, 500),
|
||||
@@ -67,8 +68,10 @@ class MainFramePanel(wx.Panel):
|
||||
bSizer1.Add(gSizer1, 1, wx.EXPAND, 5)
|
||||
|
||||
self.SetSizer(bSizer1)
|
||||
self._bindGuiEvents()
|
||||
self.Layout()
|
||||
self.btn_page2.Bind(wx.EVT_BUTTON, self.go_page2)
|
||||
|
||||
|
||||
|
||||
def empty_pole(self):
|
||||
dlg = wx.MessageDialog(self, 'Не все поля заполнены. Заполните все поля перед продолжением', 'Ошибка', wx.OK)
|
||||
@@ -76,6 +79,10 @@ class MainFramePanel(wx.Panel):
|
||||
if val == wx.ID_OK:
|
||||
dlg.Destroy()
|
||||
|
||||
def _bindGuiEvents(self):
|
||||
self.btn_page2.Bind(wx.EVT_BUTTON, self.go_page2)
|
||||
self.btn_settongs.Bind(wx.EVT_BUTTON, self.run_settings)
|
||||
|
||||
|
||||
def go_page2(self, event):
|
||||
from gui import second_page
|
||||
@@ -111,8 +118,9 @@ class MainFramePanel(wx.Panel):
|
||||
self.frame.Hide()
|
||||
second_page.run_page(self)
|
||||
|
||||
|
||||
|
||||
def run_settings(self, event):
|
||||
from gui import MainSettings
|
||||
MainSettings.run_page()
|
||||
|
||||
class MainFrame(wx.Frame):
|
||||
def __init__(self, parent):
|
||||
@@ -127,6 +135,7 @@ class MainFrame(wx.Frame):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(" ")
|
||||
app = wx.App(False)
|
||||
frame = MainFrame(None)
|
||||
frame.Show()
|
||||
|
||||
Reference in New Issue
Block a user