Skip to content

Instantly share code, notes, and snippets.

@shomah4a
Created January 27, 2011 04:50
Show Gist options
  • Save shomah4a/798084 to your computer and use it in GitHub Desktop.
Save shomah4a/798084 to your computer and use it in GitHub Desktop.
超悪い例
#-*- 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()
@ZGainsforth
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment