Created
January 27, 2011 04:50
-
-
Save shomah4a/798084 to your computer and use it in GitHub Desktop.
超悪い例
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding:utf-8 -*- | |
import wx | |
class Window(wx.Frame): | |
def __init__(self, *argl, **argd): | |
super(Window, self).__init__(*argl, **argd) | |
self.field = None | |
self.cmbField = wx.ComboBox(self) | |
self.cmbField.Append('foo') | |
self.cmbField.Append('bar') | |
self.cmbField.Append('bazz') | |
self.cmbField.Select(0) | |
self.cmbField.Bind(wx.EVT_COMBOBOX, self.callback) | |
def callback(self, evt): | |
# 状態を導入!! | |
self.field = self.cmbField.StringSelection | |
print self.field | |
app = wx.App(redirect=False) | |
w = Window(None) | |
w.Show() | |
app.MainLoop() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you!