본 내용의 출처는 이글루 블로그의 '하린아빠' 라는 네임을 쓰시는 분의 블로그입니다.
[출처] - http://pythondev.egloos.com/90018
행여나 이글루 블로그가 없어지면 참고할 곳이 사라지기에 주인장님께 댓글을 남기고 퍼 옵니다.
출처: http://slays.tistory.com/18 [Reverse Engineering]
[wxPython] wx.Button(버튼) 만들기
#!/usr/bin/python
# -*- coding: cp949 -*-
# layout.py
import wx
class MyFrame(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, wx.Size(250, 60))
# 패널 생성
panel = wx.Panel(self, -1)
# 버튼 생성
wx.Button(panel, -1, "Button1", (0,0))
wx.Button(panel, -1, "Button2", (80,0))
wx.Button(panel, -1, "Button3", (160, 0))
class MyApp(wx.App):
def OnInit(self):
frame = MyFrame(None, -1, 'layout.py')
frame.Show(True)
frame.Center()
return True
app = wx.App()
mainapp = MyApp(app)
mainapp.MainLoop()
[실행 화면]
'Language > Python' 카테고리의 다른 글
[wxPython] 계산기 만들기 (0) | 2017.02.01 |
---|---|
[wxPython] wx.BoxSizer 이용하기 (0) | 2017.02.01 |
[wxPython] wx.ToolBar 만들기 (0) | 2017.02.01 |
[wxPython] wx.ManuBar 만들기(체크, 라디오, 서브 매뉴) (0) | 2017.01.28 |
[wxPython] wx.MenuBar를 이용한 메뉴 만들기(기본) (0) | 2017.01.28 |