본 내용의 출처는 이글루 블로그의 '하린아빠' 라는 네임을 쓰시는 분의 블로그입니다.
[출처] - http://pythondev.egloos.com/107269
행여나 이글루 블로그가 없어지면 참고할 곳이 사라지기에 주인장님께 댓글을 남기고 퍼 옵니다.
[wxPython] wx.StaticText를 이용한 문자열 출력
# -*- coding: cp949 -*-
#!/usr/bin/python
# statictext.py
import wx
class MyFrame(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, wx.Size(320, 350))
lyrics1 = '''I'm giving up the ghost of love
in the shadows cast on devotion
She is the one that I adore
creed of my silent suffocation
Break this bittersweet spell on me
lost in the arms of destiny'''
lyrics2 = '''There is something in the way
You're always somewhere else
Feelings have deserted me
To a point of no return
I don't believe in God
But I pray for you'''
panel = wx.Panel(self, -1)
# StaticText를 이용한 문자열 출력
wx.StaticText(panel, -1, lyrics1, (45, 25), style=wx.ALIGN_CENTRE)
wx.StaticText(panel, -1, lyrics2, (45, 190), style=wx.ALIGN_CENTRE)
self.Centre()
class MyApp(wx.App):
def OnInit(self):
frame = MyFrame(None, -1, 'statictext.py')
frame.Show(True)
self.SetTopWindow(frame)
return True
app = MyApp(0)
app.MainLoop()
[실행 화면]
'Language > Python' 카테고리의 다른 글
[wxPython] wx.ComboBox(콤보 박스)를 사용법 및 이벤트 처리 (0) | 2017.02.06 |
---|---|
[wxPython] wx.StaticBox를 이용한 컨트롤 그룹만들기 (0) | 2017.02.06 |
[wxPython] wx.StaticLine 을 이용한 구분선 추가 (0) | 2017.02.06 |
[wxPython] wx.BitmapButton의 사용 (0) | 2017.02.06 |
[wxPython] wx.Button를 이용한 Button 이벤트 처리 와 랜덤 숫자 추출 (0) | 2017.02.06 |