0

以下は最初のパスアラウンドです。ファイルを選択し、表示ボタンをアクティブにして、ファイルを表示します。すべて良い。別のファイルを選択しようとすると、選択プロセス中に GUI が突然閉じます。変数をリセットする必要があることを理解しようとしましたが、それは変わりませんでした。すべてのインポートの後:


root = tk.Tk()
root.title("Motion GUI")
root.minsize(width=1000, height=700)
root.maxsize(width=1400, height = 900)

mainframe = ttk.Frame(root, padding="3 3 12 12")
mainframe.grid(column=0, row=0, sticky=(N,W,E,S))
root.columnconfigure(0, weight=1)
root.rowconfigure(0,weight=1)

WidgetFrame = ttk.Frame(mainframe, borderwidth=2,relief='ridge',height = 60)
WidgetFrame.grid(column=0,row=0, sticky="E,W")

def CreateWidgets():
    
    link_Label = Label(WidgetFrame, text ="Select File(s): ", bg = "#E8D579") 
    link_Label.grid(row = 1, column = 0, pady = 5, padx = 5) 
       
    WidgetFrame.sourceText = Entry(WidgetFrame, width = 50, textvariable = sourceLocation) 
    WidgetFrame.sourceText.grid(row = 1, column = 1, pady = 5, padx = 5, columnspan = 2) 
     
    source_browseButton = Button(WidgetFrame, text ="Browse", command = SourceBrowse, width = 15) 
    source_browseButton.grid(row = 1, column = 3, pady = 5, padx = 5) 
     
    viewButton = Button(WidgetFrame, text ="View File(s)", command = ViewFile, width = 15) 
    viewButton.grid(row = 3, column = 0, pady = 5, padx = 5) 

def SourceBrowse(): 

    WidgetFrame.files_list = list(filedialog.askopenfilenames(initialdir ="/mnt/data/Motion_Data/Motion_Clips",title="Press shift key plus Left mouse click to select multiple files")) 

def ViewFile():
    # plays all selected files one by one, keeps speed selected in 1st clip unless changed..
    files_list = WidgetFrame.files_list

    for f in files_list:
        player.playlist_append(f)

    player.playlist_pos = 0
    player.wait_for_playback

sourceLocation = StringVar()
destinationLocation = StringVar() 
file_list = StringVar()
CreateWidgets() 
     
root.mainloop() 

私は何が欠けていますか?

4

1 に答える 1