[tutor] TEXT CTRL

Abel Daniel abli@freemail.hu
Wed Jun 18 18:21:03 2003


Stephan Huijgen wrote:
> I have a problem with the text control in python. I want to write a string
> from a textbox to a file, but when i type for example 124 in the textbox i
> get in the file:
> 1
> 12
> 124
> in 3 lines..instead of 124 in one line...how does this work properly?

Which Gui toolkit do you use? Python has several. (Tkinter, pygtk, pyqt,
wxwindows, etc.)

Also, post a trimmed-down code example which shows the problem.
Diagnosing problems is much easier (and often only possible) I we see
exactly the same code you are having problems with.

Judging from the few info you gave, I guess the problem is that you save
the contents of the textbox after every keypress. Obviously you only
have to save when the user is finished, and clicked on a button or
pressed enter.

Abel Daniel