diff --git a/bin/curvecalc b/bin/curvecalc --- a/bin/curvecalc +++ b/bin/curvecalc @@ -342,11 +342,16 @@ def sub_commands_tk(master, curveset, su tk.Button(f, text="reload subs (C-r)", command=reload_subs).pack(side='left') - tk.Label(f, text="new subterm named (C-Enter for curve too):").pack(side='left') + tk.Label(f, text="new subterm named (C-Enter for curve too, C-n for focus):").pack(side='left') entry = tk.Entry(f, textvariable=newname) entry.pack(side='left', fill='x', exp=1) entry.bind("", add_cmd) + def focus_entry(): + entry.focus() + + dispatcher.connect(focus_entry, "focus new subterm", weak=False) + return f def savesubterms(filename,subterms): @@ -464,6 +469,8 @@ def savekey(*args): root.bind("",savekey) root.bind("", lambda evt: dispatcher.send('reload all subs')) +root.bind("", lambda evt: dispatcher.send('focus new subterm')) +root.bind("", lambda evt: dispatcher.send('focus new curve')) create_status_lines(root) for helpline in ["Bindings: C-s save subterms; Esc see current time; S-Esc see curtime to end; C-Esc show all; Mousewheel zoom; C-p play/pause music at mouse",