Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Tkinter.Text can never be empty?

Reply
Thread Tools

Tkinter.Text can never be empty?

 
 
Harry Pehkonen
Guest
Posts: n/a
 
      09-16-2003
While setting up some unit tests, I came to the conclusion that a
Tkinter Text widget can never be empty, but will always (?) contain a
\n. Here is a brief example:

>>> import Tkinter
>>> t = Tkinter.Text()
>>> t.get(0.0, Tkinter.END)

'\n'
>>> t.delete(0.0, Tkinter.END)
>>> t.get(0.0, Tkinter.END)

'\n'
>>>


My apologies, but I have not checked whether or not this can be
reproduced in Tcl/Tk (which I think might have been appropriate).

My question is: Is there *always* a trailing \n, is this a bug, or am
I doing something silly?

Thanks!
Harry.
 
Reply With Quote
 
 
 
 
vincent wehren
Guest
Posts: n/a
 
      09-16-2003
"Harry Pehkonen" <(E-Mail Removed)> schrieb im Newsbeitrag
news:(E-Mail Removed) om...
| While setting up some unit tests, I came to the conclusion that a
| Tkinter Text widget can never be empty, but will always (?) contain a
| \n. Here is a brief example:
|
| >>> import Tkinter
| >>> t = Tkinter.Text()
| >>> t.get(0.0, Tkinter.END)
| '\n'
| >>> t.delete(0.0, Tkinter.END)
| >>> t.get(0.0, Tkinter.END)
| '\n'
| >>>
|
| My apologies, but I have not checked whether or not this can be
| reproduced in Tcl/Tk (which I think might have been appropriate).
|
| My question is: Is there *always* a trailing \n, is this a bug, or am
| I doing something silly?

Nope, this is one of the idiosyncrasies of our friend the Text widget;
there's always this immortal LF at the end.

Vincent Wehren
|
| Thanks!
| Harry.


 
Reply With Quote
 
 
 
 
Harry Pehkonen
Guest
Posts: n/a
 
      09-19-2003
> | >>> t = Tkinter.Text()
> | >>> t.get(0.0, Tkinter.END)
> '\n'
> | My question is: Is there *always* a trailing \n, is this a bug, or am
> | I doing something silly?
>
> Nope, this is one of the idiosyncrasies of our friend the Text widget;
> there's always this immortal LF at the end.
>
> Vincent Wehren


Thanks, Vincent

Harry.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
You've never seen it before and you'll never see it again. Fred A Stover Computer Support 7 12-26-2007 03:33 AM
XML Schema never-never occurence of declared elements / attributes Soren Kuula XML 1 12-01-2005 01:27 PM
string routines go to never never land on unix Kevin C Programming 4 10-17-2003 06:07 PM
Re: Win98 CD is NOT bootable! never was-never will be :-) Pikoro A+ Certification 1 07-05-2003 11:02 PM
Re: Win98 CD is NOT bootable! never was-never will be :-) Andrew Tang A+ Certification 0 07-05-2003 08:23 AM



Advertisments