Python2007.12.05 06:25
ComboBox는 일반적으로 CB_DROPDOWN 스타일을 적용하여 드롭 리스트 방식으로 사용한다. 스타일을 CB_SIMPLE로 변경하면 리스트 박스처럼 사용할 수도 있다.


wx.CB_SIMPLE Creates a combobox with a permanently displayed list. Windows only.
wx.CB_DROPDOWN Creates a combobox with a drop-down list.
wx.CB_READONLY Same as wxCB_DROPDOWN but only the strings specified as the combobox choices can be selected, it is impossible to select (even from a program) a string which is not in the choices list.
wx.CB_SORT Sorts the entries in the list alphabetically.

사용자 삽입 이미지
#!/usr/bin/env python
# -*- coding: cp949 -*-
"""11-5 Combo box: pull-down choice """

# 2007.12.05

import wx

class Frame(wx.Frame):
    def __init__(self, parent=None, id=-1, title='Combo Box'):
        wx.Frame.__init__(self, parent, id, title, size=(300,300), pos=(100,100) )
        panel = wx.Panel(self)

        sampleList = ['zero', 'one', 'two', 'three', 'four', 'five',
                      'six', 'seven', 'eight'] = wx.StaticText(panel,-1,"Select one:",(15,20))
class App(wx.App):
    def OnInit(self):
        self.frame = Frame()
        return True

def main():
    app = App()

if __name__ == '__main__':

Posted by getcome