[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()

[실행 화면]


























by 하린아빠 | 2008/02/27 19:13 | wxPython | 트랙백(1) | 덧글(0)
트랙백 주소 : http://pythondev.egloos.com/tb/106918
☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]
Tracked from at 2014/03/11 00:42

:         :

:

비공개 덧글



< 이전페이지 다음페이지 >