i have a gui with text entries being assigned to variables and then written into files. but right now i have to go each time with my moust to the next entry. how do i make it so pressing enter will go to the next entry in window? or that pressing enter would submit they entry opening the next popup in the sequence?
i have:
i have:
import re from tkinter import * from tkinter import ttk import tkinter as tk root = Tk( ) global circle2centerx global circle2centery global circle2radius circle2centerx = StringVar() circle2centery = StringVar() circle2radius = StringVar() def savedata(): global circle2centerx_info global circle2centerx_entry global circle2centery_info global circle2centery_entry global circle2radius_info global circle2radius_entry circle2centerx_info = circle2centerx.get() circle2centery_info = circle2centery.get() circle2radius_info = circle2radius.get() my_function() def my_function(): circle2centerx_info = circle2centerx.get() circle2centery_info = circle2centery.get() circle2radius_info = circle2radius.get() def circle2(): with open("C:/Users/mr big/Dropbox/code/python/markers replace/content to be inserted/extend script functions/circle2.txt", 'r') as myfile: text = myfile.read() with open("C:/Users/mr big/Desktop/made function/active gui/write in 1.txt", "a") as myfile2: my_function() myfile2.write(circle2centerx_info +"," + circle2centery_info +"," + circle2radius_info) def circle2entry(): # new window definition global circle2centerx_info global circle2centerx_entry global circle2centery_info global circle2centery_entry global circle2radius_info global circle2radius_entry Label(circle2window, text = "circle2 center x * ").pack() circle2centerx_entry = Entry(circle2window, textvariable = circle2centerx) circle2centerx_entry.pack() Label(circle2window, text = "circle2 center y * ").pack() circle2centery_entry = Entry(circle2window, textvariable = circle2centery) circle2centery_entry.pack() Label(circle2window, text = "circle2 radius * ").pack() circle2radius_entry = Entry(circle2window, textvariable = circle2radius) circle2radius_entry.pack() Label(circle2window, text = "").pack() Button(circle2window, text = "savedata", width = 10, height = 1, command = savedata).pack() Label(circle2window, text = "").pack() Button(circle2window, text = "write function", width = 10, height = 1, command = circle2).pack() Label(root, text = "").pack() Button(root, text = "circle2", width = 100, height = 1, command = circle2entry).pack() #Menu Bar menu = Menu(root) root.config(menu=menu) file = Menu(menu) file.add_command(label = 'Exit', command = lambda:exit()) root.mainloop()