1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
import wx
class maissa(wx.Frame):
def __init__(self,parent,id):
wx.Frame.__init__(self,parent,id,"la fenetre dessai",size=(300,300))
panel=wx.Panel(self)
boutton=wx.Button(panel,label="ouvrir",pos=(130,10),size=(60,60))
self.Bind(wx.EVT_BUTTON,self.fct,boutton)
def fct(self,event):
##wxString rep
wxDirDialog dlg= wxDirDialog(wxWindow* parent, const wxString& message = "Choose a directory", const wxString& defaultPath = "", long style = wxDD_DEFAULT_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxString& name = "wxDirCtrl")
if ( dlg->ShowModal() == wxID_OK ):
rep=dlg.GetPath();
if __name__=='__main__':
app=wx.PySimpleApp()
frame=maissa(parent=None,id=-1)
frame.Show()
app.MainLoop() |
Partager