def on_file_clicked(self, widget):
# dialog = Gtk.FileChooserDialog("Please choose a file", self,
# Gtk.FileChooserAction.OPEN,
# (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
# Gtk.STOCK_OPEN, Gtk.ResponseType.OK))
# response = dialog.run()
# if response == Gtk.ResponseType.OK:
# path = dialog.get_filename()
# # self.open_file.set_label("File Selected: %s" % os.path.basename(path))
# self.data = pd.read_csv(path)
# elif response == Gtk.ResponseType.CANCEL:
# print("Cancel clicked")
# dialog.destroy()
dialog = FileDialog(self)
# dialog.show_all()
response = dialog.run()
if response == Gtk.ResponseType.OK:
self.data = dialog.data
dialog.destroy()
评论列表
文章目录