How to save new text in text box 
Author Message
 How to save new text in text box

This may not be the correct place to ask this question,
but...  I am new to TCL and am writing a small app which involves displaying
a text file in a text box.  After adding text, I want to
save to the original file but so far cannot find a way to
do this.  Please help!


Sat, 10 May 1997 01:28:15 GMT  
 How to save new text in text box

Quote:

>This may not be the correct place to ask this question,
>but...  I am new to TCL and am writing a small app which involves displaying
>a text file in a text box.  After adding text, I want to
>save to the original file but so far cannot find a way to
>do this.  Please help!

        set fd [open $filename w]
        puts $fd [.text get 0.0 end]
        close $fd

Of course this may actually put in one more newline than you want/expect.

==========================================================================
* Gerald W. Lester                        !   Voice:  (504)-889-2784     *
* Computerized Processes Unlimited        !   FAX:    (504)-889-2799     *

* Metairie, LA  70001                     !   Hours:  09:00-17:00 CDT    *
==========================================================================



Sat, 10 May 1997 11:30:57 GMT  
 How to save new text in text box

Quote:

>>This may not be the correct place to ask this question,
>>but...  I am new to TCL and am writing a small app which involves displaying
>>a text file in a text box.  After adding text, I want to
>>save to the original file but so far cannot find a way to
>>do this.  Please help!

>    set fd [open $filename w]
>    puts $fd [.text get 0.0 end]
>    close $fd

>Of course this may actually put in one more newline than you want/expect.

Sorry, should have read 1.0 not 0.0!

==========================================================================
* Gerald W. Lester                        !   Voice:  (504)-889-2784     *
* Computerized Processes Unlimited        !   FAX:    (504)-889-2799     *

* Metairie, LA  70001                     !   Hours:  09:00-17:00 CDT    *
==========================================================================



Sat, 10 May 1997 11:32:17 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Newbie - Saving text from text window

2. How to save text in a text widget?

3. How to colorize, change font of text in text box

4. Accessing text in other applications windows text boxes

5. OODIALOG: TEXT MISSING IN A TEXT BOX

6. text file and text box script

7. more included text than new text?

8. Following new text in a text window

9. Some questions on elided text in the text widget (and a few other text widget questions)

10. Text editor that saves emphases?

11. Open and Save Styled Text

12. Saving Styled text to Binary File

 

 
Powered by phpBB® Forum Software