본 내용의 출처는 이글루 블로그의 '하린아빠' 라는 네임을 쓰시는 분의 블로그입니다.
[출처] - http://pythondev.egloos.com/106918
행여나 이글루 블로그가 없어지면 참고할 곳이 사라지기에 주인장님께 댓글을 남기고 퍼 옵니다.
출처: http://slays.tistory.com/35 [Reverse Engineering]
[wxPython] wx.StaticLine 을 이용한 구분선 추가
# -*- coding: cp949 -*-
#!/usr/bin/python
# centraleurope.py
import wx
class MyDialog(wx.Dialog):
def __init__ (self, parent, ID, title):
wx.Dialog.__init__(self, parent, ID, title, size=(360, 370))
font = wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD)
heading = wx.StaticText(self, -1, 'The Central Europe', (130, 15))
heading.SetFont(font)
# StaticLine 추가
wx.StaticLine(self, -1, (25, 50), (300,1))
wx.StaticText(self, -1, 'Slovakia', (25, 80), style=wx.ALIGN_RIGHT)
wx.StaticText(self, -1, 'Hungary', (25, 100), style=wx.ALIGN_RIGHT)
wx.StaticText(self, -1, 'Poland', (25, 120), style=wx.ALIGN_RIGHT)
wx.StaticText(self, -1, 'Czech Republic', (25, 140))
wx.StaticText(self, -1, 'Germany', (25, 160))
wx.StaticText(self, -1, 'Slovenia', (25, 180))
wx.StaticText(self, -1, 'Austria', (25, 200))
wx.StaticText(self, -1, 'Switzerland', (25, 220))
wx.StaticText(self, -1, '5 379 000', (250, 80))
wx.StaticText(self, -1, '10 084 000', (250, 100))
wx.StaticText(self, -1, '38 635 000', (250, 120))
wx.StaticText(self, -1, '10 240 000', (250, 140))
wx.StaticText(self, -1, '82 443 000', (250, 160))
wx.StaticText(self, -1, '2 001 000', (250, 180))
wx.StaticText(self, -1, '8 032 000', (250, 200))
wx.StaticText(self, -1, '7 288 000', (250, 220))
# StaticLine 추가
wx.StaticLine(self, -1, (25, 260), (300,1))
sum = wx.StaticText(self, -1, '164 102 000', (240, 280))
# 현재 폰트 정보 변경
sum_font = sum.GetFont()
sum_font.SetWeight(wx.BOLD)
sum.SetFont(sum_font)
wx.Button(self, 1, 'Ok', (140, 310), (60, 30))
self.Bind(wx.EVT_BUTTON, self.OnOk, id=1)
self.Centre()
def OnOk(self, event):
self.Close()
class MyApp(wx.App):
def OnInit(self):
dia = MyDialog(None, -1, 'centraleurope.py')
dia.ShowModal()
dia.Destroy()
return True
app = MyApp()
app.MainLoop()
[실행 화면]
'Language > Python' 카테고리의 다른 글
[wxPython] wx.StaticBox를 이용한 컨트롤 그룹만들기 (0) | 2017.02.06 |
---|---|
[wxPython] wx.StaticText를 이용한 문자열 출력 (0) | 2017.02.06 |
[wxPython] wx.BitmapButton의 사용 (0) | 2017.02.06 |
[wxPython] wx.Button를 이용한 Button 이벤트 처리 와 랜덤 숫자 추출 (0) | 2017.02.06 |
[wxPython] 다이얼로그(Dialog) 만들기2 (0) | 2017.02.06 |