-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdecennialsframe.py
More file actions
39 lines (34 loc) · 1.26 KB
/
decennialsframe.py
File metadata and controls
39 lines (34 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- coding: utf-8 -*-
import wx
from decennialswnd import DecWnd, DecStartDlg
class DecennialsFrame(wx.Frame):
XSIZE = 380
YSIZE = 480
def __init__(self, parent, title, chrt, opts):
wx.Frame.__init__(self, parent, -1, title, wx.DefaultPosition,
wx.Size(DecennialsFrame.XSIZE, DecennialsFrame.YSIZE))
self.fpathimgs = u""
self._parent = parent
self._chrt = chrt
self._opts = opts
# 선택 팝업을 이벤트 큐에서 띄우고(커서 꼬임 방지), 선택 후에 화면 생성
self.Hide()
wx.CallAfter(self._ask_and_build)
def _ask_and_build(self):
# 프레임 자신을 부모로 모달을 띄워 포커스 문제 방지
dlg = DecStartDlg(self)
dlg.CentreOnScreen()
rc = dlg.ShowModal()
if rc != wx.ID_OK:
dlg.Destroy()
self.Destroy()
return
token = dlg.get_token()
dlg.Destroy()
# 이제 패널 생성 + 계산
self.w = DecWnd(self, self._chrt, self._opts, self._parent)
self.w.set_start_selector(token)
self.w.compute_and_draw()
self.SetMinSize((200, 200))
self.Show(True)
self.Raise()