in reply to perl Tk ?s

By default how can you have the cursor be in a text box to type?

Do you mean a Text widget, or Entry widget when you say "text box". For an Entry widget, you don't need to activate the submit button. The way you do it, is to have bindings to the same callback. I assume that is what you want, and only think you want to actually activate the button, which is a useless step in most cases.

#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = new MainWindow; my $ent = $mw -> Entry( -bg => 'white', ) -> pack(); $ent->focus; # so cursor is there in the entry $ent->bind('<Return>', \&process_it ); my $button = $mw->Button(-text => 'Submit', -command => \&process_it )->pack(); MainLoop; sub process_it { my $var = $ent->get(); print "$var submitted\n" }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh