This is something obvious, so apologies for the ignorant question. Based on the below snippet, can you advise how I can fix this example to get focus on 'Field 2'. I still want Fields 1-3 to be editable, but I want the focus and .editing to start at a specific field:
import npyscreen
class TestApp(npyscreen.NPSApp):
def main(self):
F = npyscreen.Form(name = "I want to change the initial focus and edit Field 2")
f0 = F.add(npyscreen.TitleText, name = '# widg:', editable = False)
f1 = F.add(npyscreen.TitleText, name = "Field 1:")
f2 = F.add(npyscreen.TitleText, name = "Field 2:")
f3 = F.add(npyscreen.TitleText, name = "Field 3:")
no_of_widgets = len(F._widgets__)
F._widgets__[0].value = str(no_of_widgets)
for i in range(1, no_of_widgets): F._widgets__[i].value = str(i)
f1.editing = False # 1) does not stop f1 from being edited
F.editw = 2 # 2) does not change focus to f2
F.edit()
if __name__ == "__main__": TestApp().run()