AltEntry Widget が「アクティブ」になるようにウィンドウを変更しようとしています。ウィジェットをクリックせずに入力すると、ボックスに直接入力できます (IDLE の+ウィンドウと同じですM--- ウィンドウが開いたときに、 Entrybox をクリックすると、そこに入力できます)。
私は使用してみましたentry.icursor()
:
from Tkinter import *
class GetFileName:
def __init__(self, master):
self.frame = Frame(master)
self.entryFrame = Frame(self.frame)
self.fEntry = Entry(self.entryFrame, width = 50, justify = CENTER)
self.fEntry.icursor(0) # thought this would make it "active"
# a bunch of other widgets
self.fEntry.grid(row = 1, column = 2, padx = 5, pady = 5)
self.entryFrame.grid(row = 1)
self.frame.grid()
root = Tk(className = ' Module Opener')
app = GetFileName(root)
root.rowconfigure(0, weight = 1)
root.columnconfigure(0, weight = 1)
root.mainloop()
これをアクティブなウィンドウにするにはどうすればよいですか? ありがとう!