Python2007.11.28 07:22
간단한 라디오 버튼을 만들어 보자. RadioButton()으로 버튼을 만든다.

RadioButton API ref.: http://www.wxpython.org/docs/api/wx.RadioButton-class.html

사용자 삽입 이미지
#!/usr/bin/env python

"""11-1a. RadioButton """

# http://withrobot.tistory.com
# 2007.11.27

import wx

class Frame(wx.Frame):
    def __init__(self, parent=None, id=-1, title='RadioButton'):
        wx.Frame.__init__(self, parent, id, title, size=(300,300), pos=(100,100) )
        panel = wx.Panel(self)
        radio1 = wx.RadioButton(panel,-1,"라디오1",(35,40))
        radio2 = wx.RadioButton(panel,-1,"라디오2",(35,60))
        radio3 = wx.RadioButton(panel,-1,"라디오3",(35,80))
       
class App(wx.App):
    def OnInit(self):
        self.frame = Frame()
        self.frame.Show()
        return True

def main():
    app = App()
    app.MainLoop()

if __name__ == '__main__':
    main()
Posted by getcome