2008/10/31 <[EMAIL PROTECTED]>: > Hi tutors. > > Is there a way to remap a tab key to enter a user-specified number of spaces > in a Tkinter text widget instead of a genuine tab? An internet search has > turned up zilch. The tab option in a text widget lets you enter the number of > centimeters to space over, but this option is truly useless when you want > real live spaces instead. > > I tried using 'bind' to call a method that inserts 4 spaces, for example, but > this approach enters the number of spaces AND a tab as well (as expected, > after thinking about it). Not good.
My Tkinter is a bit rusty, but the latter approach might be the one to take. Just remember to return 'break' at the end of your callback. This prevents the event from being passed on to the text widget. -- John. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor