Implement Python3 Functionality Fixes
This commit is contained in:
parent
ed0faa2c7a
commit
237ce7e164
45
app.py
45
app.py
@ -8,9 +8,9 @@ Created on Fri Sep 4 11:36:24 2020
|
||||
V0.3 Igor Beloschapkin
|
||||
"""
|
||||
|
||||
from Tkinter import *
|
||||
import tkFont
|
||||
import tkMessageBox
|
||||
from tkinter import *
|
||||
import tkinter.font as tkFont
|
||||
#import tkMessageBox
|
||||
import os
|
||||
|
||||
# own code:
|
||||
@ -37,16 +37,14 @@ pathP300Classifier = r'C:\Users\bci\Desktop\Igor\PythonBCIgui_v0.2\bin'
|
||||
class App:
|
||||
|
||||
def __init__(self, master):
|
||||
global lastType
|
||||
lastType = "NONE"
|
||||
self.paradigmText = sys.argv[1]
|
||||
App.paradigmText = sys.argv[1]
|
||||
#print sys.argv[1]
|
||||
pathOrigin = os.path.dirname(os.path.realpath(__file__))
|
||||
# self.paradigmText = sys.argv[1]
|
||||
# App.paradigmText = sys.argv[1]
|
||||
# print sys.argv[1]
|
||||
# pathOrigin = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
global pathSave
|
||||
pathSave = "\\questions\\" + self.paradigmText
|
||||
pathSave = os.getcwd() + pathSave
|
||||
# global pathSave
|
||||
# pathSave = "\\questions\\" + self.paradigmText
|
||||
# pathSave = os.getcwd() + pathSave
|
||||
|
||||
|
||||
textH = 2
|
||||
@ -71,7 +69,7 @@ class App:
|
||||
frame.pack()
|
||||
|
||||
# button generation
|
||||
self.BtacControl = makeBtn(self, "1. Control", "lightblue", self.btn_tacControl, LEFT)
|
||||
self.Bfilter = makeBtn(self, "1. Filter", "lightblue", self.btn_filter, LEFT)
|
||||
self.BtacCal = makeBtn(self, "2. Calibrate", "lightblue", self.btn_tacCal, LEFT)
|
||||
self.Bp300 = makeBtn(self, "3. P300 Classifier", "lightblue", self.btn_p300, LEFT)
|
||||
self.BtacCopy = makeBtn(self, "Tactile Copy", "lightblue", self.btn_tacCopy, LEFT)
|
||||
@ -80,14 +78,14 @@ class App:
|
||||
frame.rowconfigure((0,1), weight=1) # make buttons stretch when
|
||||
frame.columnconfigure((0,2), weight=1) # when window is resized
|
||||
|
||||
self.BtacControl.grid(row=0, column=0, columnspan=1, sticky='EWNS')
|
||||
self.BtacCal.grid(row=1, column=0, columnspan=1, sticky='EWNS')
|
||||
self.Bp300.grid(row=2, column=0, columnspan=1, sticky='EWNS')
|
||||
self.BtacCopy.grid(row=3, column=0, columnspan=1, sticky='EWNS')
|
||||
self.BtacQuest.grid(row=4, column=0, columnspan=1, sticky='EWNS')
|
||||
# self.Bfilter.grid(row=0, column=0, columnspan=1, sticky='EWNS')
|
||||
# self.BtacCal.grid(row=1, column=0, columnspan=1, sticky='EWNS')
|
||||
# self.Bp300.grid(row=2, column=0, columnspan=1, sticky='EWNS')
|
||||
# self.BtacCopy.grid(row=3, column=0, columnspan=1, sticky='EWNS')
|
||||
# self.BtacQuest.grid(row=4, column=0, columnspan=1, sticky='EWNS')
|
||||
|
||||
# 1. FILTER ##################################
|
||||
def btn_tactorControl(self):
|
||||
def btn_filter(self):
|
||||
print('Starte TactileBCIFilter.exe')
|
||||
os.startfile(pathTactileBciFilter + '\TactileBCIFilter.exe')
|
||||
|
||||
@ -130,11 +128,16 @@ class App:
|
||||
|
||||
def global_close(self, window):
|
||||
print('quitting?')
|
||||
if tkMessageBox.askokcancel("Quit", "Nach einer BCI Sitzung bitte an den Fragebogen denken! :) OK zum Beenden."):
|
||||
window.destroy()
|
||||
window.destroy()
|
||||
|
||||
|
||||
root = Tk()
|
||||
|
||||
def on_closing():
|
||||
#self.global_close(root)
|
||||
print('quitting?')
|
||||
root.destroy()
|
||||
|
||||
root.protocol("WM_DELETE_WINDOW", on_closing)
|
||||
app = App(root)
|
||||
root.mainloop()
|
||||
|
Loading…
x
Reference in New Issue
Block a user