Forum Archive

Pre fill Textfield

swoiwode

Porting over code from a Tinker desktop application. To improve the user experience I am used to populating input field values with those last entered at last runtime. Something that was part of the Palm programming standard, using preferences. So I think I need to understand how to 'see' a Textfield and set the text value with .set(parser.get(,) before it is display, or just afterward. With Tinker this was done with = tk.StringVar(). As a side note, I'd like to get the InputText = sender.superview['InputText'] outside of the Button def too. Thanks, Scott

JonB

Are you creating your ui's programatically, or with ui editor?
If using the editor, you would do

v=load_view('myview')
v['textfield1'].text = sometext

where textfield1 is replaced with whatever you named your textfield. If you have multiple layers of views, you will need to address each level, e.g.

v['textframe']['textfield1']