2
timezone1 목록 상자에서 zone_list 중 하나를 클릭하면 해당 문자열을 time_zones2 목록 상자에 삽입하고 그 후에 다른 선택 항목을 선택하면 두 번째 선택 항목을 timezones2 목록 상자의 두 번째 줄에 추가하고 싶습니다. 그런 다음 이전에 time_zone2 목록 상자에서 한 선택 사항 중 하나를 클릭하면 해당 선택 항목을 삭제하려고합니다. 내가 아래에 한 일을 봐>를 choice- 클릭 listbox2wxpython : 한 목록 상자에서 다른 목록 상자에 여러 문자열 삽입
에서 그 선택을 삭제 listbox2>를 choice-에 에 ListBox1를 클릭 listbox2 에 그 선택을 삽입 :
이
는 내가하고 싶은 것입니다import wx
from time import *
class MyFrame(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, (550, 350))
zone_list = ['CET', 'GMT', 'MSK', 'EST', 'PST', 'EDT']
panel = wx.Panel(self, -1)
self.time_zones = wx.ListBox(panel, -1, (10,100), (170, 130), zone_list, wx.LB_SINGLE)
self.time_zones.SetSelection(0)
self.time_zones2 = wx.ListBox(panel, -1, (10,200), (170, 400), '',wx.LB_SINGLE)
self.Bind(wx.EVT_LISTBOX, self.OnSelect)
def OnSelect(self, event):
index = event.GetSelection()
time_zone = self.time_zones.GetString(index)
self.time_zones2.Set(time_zone)
class MyApp(wx.App):
def OnInit(self):
frame = MyFrame(None, -1, 'listbox.py')
frame.Centre()
frame.Show(True)
return True
app = MyApp(0)
app.MainLoop()
매우 정확하게 일치하는 것이 무엇인지 찾고 있습니다 !!!! – TLSK