Hello world!!!
Ok, I've undestand how to fill a wxListBox with selected files.
But, why I can't fill my ListBox with this code?
Is there an another way to do this?
class MainWindow(wxFrame):
def __init__(self,parent,id,title):
wxFrame.__init__(self,parent,-4, title, size = ( 500,600),
style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
barre_de_menu = wxMenuBar()
file_menu01 = wxMenu()
file_menu01.Append(ID_OPEN, "Open...\\tCtrl+O", "Cliquez sur Open pour ouvrir un fichier")
barre_de_menu.Append(file_menu01, "&File")
self.SetMenuBar(barre_de_menu)
EVT_MENU(self, ID_OPEN, self.OnOpen)
def OnOpen(self, event):
""" Open a file"""
dirname = 'c:\\media'
dlg = wxFileDialog(self, "Choose a file :", dirname, "", "*.*", wxOPEN|wxMULTIPLE) #
if dlg.ShowModal() == wxID_OK:
self.filename=dlg.GetFilename()
self.dirname=dlg.GetDirectory()
event = Form1(frame, -1)
for path in dlg.GetPaths():
event.lb1.Append(path)
class Form1(wxPanel):
def __init__(self, parent, id):
self.panel = wxPanel.__init__(self, parent, id)
List_Song = []
self.lb1 = wxListBox(self, 60, wxPoint(300, 150), wxSize(80, 120),
List_Song, wxLB_SINGLE)
Thanks for all!!!