Re: text - going to specific line numbers.
- From: "Dave (from the UK)" <see-my-signature@xxxxxxxxxxxxx>
- Date: Thu, 26 Jul 2007 11:42:07 +0100
Quite right. After creation, you have a text box that, when managed
will occupy an area that is 7 lines long.
Thanks for clarifying this - and to Ron too, who also made some helpful suggestions.
$statsresults delete 4.0 4.end
will that achieve it, or do all the other line numbers change, the fact
one has been deleted?
That will work. 4.end is just before the newline, so nothing else
changes. Continuing my example above
$statusresults delete 4.0 4.end
$statusresults insert "Some new text for line 4"
Should do the trick.
Perhaps instead I should write just a newline on the line I want to clear:
$statsresults insert 4.0 "\n"
If you do this, you will change the existing lines 4-7 to lines 5-8
which is almost certainly not what you want.
You are right - it was not what I wanted!
Note also that text widget line numbers start from one rather than
zero. Writing to line zero appears not to be an error, it just gets
silently converted to line one.
I was aware of that, although I know the code snippit i posted refereed to line 0.
Finally, it looks as though you will be using your seven lines to
format things in a fixed way. Have you considered a set of 7 label
widgets, rather than a single 7-line text widget? It might be less
confusing to code.
Its possible I might want to do a bit of formatting (underlining a word, putting a few characters in a proportional font etc), which I think would be easier in a text box.
Hope this helps,
Yes it did Alan, thank you.
Dave (from the UK)
Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@xxxxxxxxxxxx
Hitting reply will work for a few months only - later set it manually.
http://chessdb.sourceforge.net/ - a Free open-source Chess Database
- Prev by Date: Re: text - going to specific line numbers.
- Next by Date: Re: Binary to Hexadecimal Conversion
- Previous by thread: Re: text - going to specific line numbers.
- Next by thread: Re: text - going to specific line numbers.