def __init__(self):
w=Gtk.Window()
dialog = Gtk.FileChooserDialog(_("Choose a file"), w,Gtk.FileChooserAction.OPEN,(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,Gtk.STOCK_OPEN, Gtk.ResponseType.OK))
dialog.set_default_size(800, 400)
response = dialog.run()
self.module = '-1'
if response == Gtk.ResponseType.OK:
self.module=dialog.get_filename()
elif response == Gtk.ResponseType.CANCEL:
print("Cancel clicked")
dialog.destroy()
评论列表
文章目录