f



redirect text to file; text widget

I've loaded text from a file into the text widget, and having edited it would like to redirect it back into a file, but haven't found a handle for it. If there was an attribute such as the "-textvariable" option for the entry and label widgets, I could echo it into a file from another widget (button, etc).  Thanks
0
john6309 (18)
7/1/2006 6:31:02 PM
comp.lang.tcl 23428 articles. 2 followers. Post Follow

2 Replies
880 Views

Similar Articles

[PageSpeed] 43

..t get 0 end

"John Peters" <john@jpeters.net> wrote in message 
news:20060701143102.70526542.john@jpeters.net...
>
> I've loaded text from a file into the text widget, and having edited it 
> would like to redirect it back into a file, but haven't found a handle for 
> it. If there was an attribute such as the "-textvariable" option for the 
> entry and label widgets, I could echo it into a file from another widget 
> (button, etc).  Thanks 


0
net8344 (13)
7/5/2006 10:58:26 AM
Usman,

Your solution is incorrect. The first character in a text index is 1.0, 
not 0.

Usman Muzaffar wrote:
> .t get 0 end
> 
> "John Peters" <john@jpeters.net> wrote in message 
> news:20060701143102.70526542.john@jpeters.net...
> 
>>I've loaded text from a file into the text widget, and having edited it 
>>would like to redirect it back into a file, but haven't found a handle for 
>>it. If there was an attribute such as the "-textvariable" option for the 
>>entry and label widgets, I could echo it into a file from another widget 
>>(button, etc).  Thanks 
> 
> 
> 


-- 
Bryan Oakley
http://www.tclscripting.com
0
oakley (2074)
7/5/2006 4:43:50 PM
Reply:

Similar Artilces:

redirect text to file from text widget
I'm looking for a handle for the text widget so that I can redirect edited text orginally loaded from a file back into a file. If there was an attribute like the "-textvariable" option in label and entry widgets, I could simply echo it into a file from another widget (button, etc.). Thanks John Peters wrote: > I'm looking for a handle for the text widget so that I can redirect > edited text orginally loaded from a file back into a file. If there > was an attribute like the "-textvariable" option in label and entry > widgets, I could simply echo it into...

text in a widget, text-widget
hello i have an application with a couple of text widgets but i would like to add some functionalities that at first and second sight are not directly supported by the plain text widget itself - ? for example i would like certain lines of text within the textwidget to take different background colors according to certain parameters also i would like to be able to detect certain sentences or words that would become 'links' and by clicking them i would open up different windows any suggestions to solutions and widgets for the above problems ? - i probably could...

Reading Text File, Text Scrolling and erase line from a text file
Hi , How can I Reading Text File, then Text Scrolling by means of keys "page UP" "page Down" and erase a specific line from a text file , when press "F2" key? Best Regards, Lidia from Poland -- ========================================= Pozdrawiam Lidiaa Lidiaa schrieb: > Hi , > > How can I Reading Text File, then Text Scrolling by means of > keys "page UP" "page Down" and erase a specific line from a text > file , when press "F2" key? > > ...

RE: text in a widget, text-widget
You can use tags with in the text widget. See the documentation in Tk::Text for more explanation on how they work. How to configure: $scrolled->tagConfigure('BLUE',-background => 'blue'); $scrolled->tagConfigure('RED',-foreground => 'red'); $scrolled->tagConfigure('GREEN',-foreground => 'green'); Here is how I use them: $scrolled->insert('end',$job_header,'RED') if ($job_header); $scrolled->insert('end',$running_proc,'BLUE') if ($running_proc); $scro...

Re: text in a widget, text-widget @ 1145998849
Intrah onat Diria .. Tue, 25 Apr 2006 13:55:44 -0700 , ****** wrote "Revera y": > of "unsubscribe ptk" to majordomo@lists.stanford.edu > If you wish to unsubscribe from this mailing list, send the message body > This message was posted through the Stanford campus mailing list server. > ++**=3D=3D > -++**=3D=3D--++**=3D=3D--++**=3D=3D--++**=3D=3D--++**=3D=3D--++**=3D=3D--= > > > > > ,=20 > , _________________ > , |---| > , | > , lead > , ::::::opthe > , oo,loent,uaha > , }, > ,...

text + text
What is "text + text" supposed to do right now? It doesn't seem very useful to me. What about making "text + text" as an equivalent for "text || text"? Most strongly-typed programming languages do this. And MS SQL Server too, I think (CMIIW). -- dave ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org Am Freitag, 8. Oktober 2004 12:57 schrieb David Garamond: > What is "text + text" supposed to do right now? Nothing. > What a...

text-text
Wondering how what I input to my UTF-8 terminal gets passed along through my patched [1] trn ... Cyrillic: А Б В Г Д Е Ж З И Й К Л М Н О П а б в г д е ж з и й к л м н о п IPA: ᴀ ᴁ ᴂ ᴃ ᴄ ᴅ ᴆ ᴇ ᴈ ᴉ ᴊ ᴋ ᴌ ᴍ ᴎ ᴏ ɀ Ɂ ɂ Ƀ Ʉ Ʌ Ɇ ɇ Ɉ ɉ Ɋ ɋ Ɍ ɍ Ɏ ɏ [1] https://groups.google.com/d/msg/comp.sys.raspberry-pi/7Z37Hdrm0DM/6aqD-reXFzAJ ...

RE: text in a widget, text-widget #2
Johan, Here this will give you an idea how to create a link in a text widget as well as some other tags. HTH Mike use strict; use Tk; use Tk::Dialog; my $mainWindow = MainWindow->new(-title => "Test Tags"); my $sc_width = 100; my $sc_height = 15; my $scrolled = $mainWindow->Scrolled( "Text", -scrollbars => 'se', -background => 'white', -wrap => &...

Re: text in a widget, text-widget @ 1146167556
Intrah onat Diria .. Tue, 25 Apr 2006 13:55:44 -0700 ,Van Nieuwenhuize, Mike wrote "Noalim y": > > Johan, > > Here this will give you an idea how to create a link in a text widget as > well as some other tags. > > HTH > > Mike > > use strict; > use Tk; > use Tk::Dialog; > > my $mainWindow = MainWindow->new(-title => "Test Tags"); > > my $sc_width = 100; > my $sc_height = 15; > > my $scrolled = $mainWindow->Scrolled( > ...

Tkinter question: howto redirect text output (stdout) to Text widget?
hi all, could anyone post an example how to redirect text output (stdout) to Text widget? Thank you in advance, Dmitrey. ...

concatenating multiple text files into one text file
Hello all, I have a huge number of text files like : spectrum1_300_315.csv spectrum1_315_331.csv spectrum1_331_364.csv spectrum1_364_386.csv spectrum1_386_401.csv ...................................... ....................................... each file contains some headerlines at the beginning and data in 2 columns. I want to concatenate the data of the files into one text file .Can anyone hel me pls?thank u in advance. ...

RE: text in a widget, text-widget @ 1146167556 #3
Johan, Got to thinking about something that may work for you. Please see my modified code. Basically The only thing that I give it a is a list of words, the tag and tag bind is generated on the fly. Maybe using an approach like this will get you closer to what you wanted. Still kinda lame as you have to create a new tag for each word or in this case url but it at least will allow you to do it on the fly. Mike use strict; use Tk; use Tk::Dialog; my $mainWindow = MainWindow->new(-title => "Test Tags"); my $sc_width = 100; my $sc_height = 15; ...

Converting A Unicode Text File to An ASCII Text File
We have a large number of text files built in Unicode that we need to be read by SAS. SAS does not read Unicode text. To convert the Unicode text to ASCII text we did the following: A Unicode text file adds an additional blank space to each character. To remove this blank character, you can use the code below. The hexidecimal value '00' is a blank character. So remove it using the SAS statement '00'x. The 'x' tells SAS you are reading hexidecimal. Use RECFM=N to tell SAS that you are reading a stream of data that will not conform to a typical file structure. SAS will ...

Failed to write to a text file (text file is RW)
Hi, I dig up the following script. Added a simple HTML file with a form field named "vote" and have it send to the following php script. However, it failed to write to the poll_result.txt file. Why? Thanks as usual. <?php $vote = $_REQUEST['vote']; //get content of textfile $filename = "poll_result.txt"; $content = file($filename); //put content in array $array = explode("||", $content[0]); $yes = $array[0]; $no = $array[1]; if ($vote == 1) { $yes = $yes + 1; } if ($vote == 0) { $no = $no + 1; } // debug echo $yes; echo $no; // ou...

RE: text in a widget, text-widget @ 1146167556 #2
Not sure exactly what you are trying to do but it sounds like you want word that is clicked on. Quick and dirty way would be: $scrolled->selectWord(); my $word = $scrolled->getSelected(); The above will only get a single word, so would be a challenge if you have a link with multiple words. Lame way: create a separate tag for each word and bind that to a sub for that particular word. These seems like a lot of overhead and I would imagine Text widget would have better feature you can leverage on. Efficient way: ? I will leave that up to you ;) or someone else mor...

matrix and text to a text file
Hi, I know some similar question have been solved before but I have been reading for a while and I didn't find the answer of my question so, I ask you. I want to create a text-file (.txt) where I will have some text and some matrixs. The format that i want is something like that: -Title- Name1. Name2. power(dbm): big matrix (12000X400) aprox frequency(hz) vector(1x12) aprox So, i created a m-file that can do this writing with fprintf every single character on the file using lots of for loops. It works good but if the matrix is that size it could take a time (about 7 min...

text file not mac text
please remind me of the difference. An 8-bit prog. I have needs ASCII text. if I save a file as TEXT or simpletext on a mac, it isnt accepted. I remember 'forked files' but no details...... Is there a II utilty to 'convert' a mac text file to acceptable II ascii text? thanks. cornelio <cornelio@san.rr.com> wrote: > please remind me of the difference. An 8-bit prog. I have needs ASCII > text. if I save a file as TEXT or simpletext on a mac, it isnt accepted. > I remember 'forked files' but no details...... > > Is there a II utilty to '...

highlight text in text widget
Hi, I am trying to make widget that displays text. I also want a search keywords available. The way I have envisioned is something similar to emacs search, i.e. it highlights all the occurrences of the keyword that you are interested in. I am trying to find out if that kind of highlighting be done in widget_text or some other widgets. Can anyone help? Thanks neon writes: > I am trying to make widget that displays text. I also want a search > keywords available. The way I have envisioned is something similar to > emacs search, i.e. it highlights all the occurrences of the keyword &g...

Text in images to a text file
Hello, Does anyone know of any software for Linux which converts text in images to a text file. I have loads of paper documents that I intend to scan. The contents of these documents needs to eventually end up on a web site but as text. Darren <bobblebob@gmail.com> wrote in message news:1151612491.407262.124690@75g2000cwc.googlegroups.com > Does anyone know of any software for Linux which converts text in > images to a text file. I have loads of paper documents that I intend > to scan. The contents of these documents needs to eventually end up > on a web site but as text....

in Tcl/tk, How can I redirect stdout to a text widget?
I already wrote a tcl script. there are many output information sent to stdout in the script. Now I'm using TK to optimize this script, I hope to redirect all output information to a text widget, How can i do it? I tried to rediect output information to a file, it's OK. then I want to use "fileevent" command to trace the file's action and then send new information to a text widget. but system say that "filehandle cannot be read" error. I think that the reason should be the file is open for "w" and cannot be read. How can i do it? close stdout ...

Re: Converting A Unicode Text File to An ASCII Text File
Mike, SAS does not read Unicode text. It is not true encoding=utf8 exist HTH Andre I tried upon this contents (a french one saved in utf8) but showed here in windows Nom,Adressé "Bob","cité Bergère" "Ann","impasse Dôme" with this code under sas windows options validvarname=any; filename a "z:\utf8.csv" encoding=utf8; PROC IMPORT OUT= WORK.PAPER3 DATAFILE=a DBMS=CSV REPLACE; GETNAMES=YES; DATAROW=2; RUN; the results are Nom Adress� Bob cit� Berg�re Ann impasse D�me But perhaps you have another problem...

Read a non text file
How can i convert a weird looking file to text file. I know the main info is stored in the file which looks like below. "����<t���Jч�ĉTV��y�rr��Ph"e~Wm>�E�0Y'p�=C�&�rؙ�<t�Fx�Zo$�+T��=���H Or�r6�S��m&7<�p�q��� u����w}�jlꥎ+_�����Z�?��v��ȉ�XC R�}�_�׍�:�$)�o}��NʨW\&���I@b�#T�B��8���J��CL�ypr\�]R���p\��S�XRҏ�f&?/��� 2�t�_��x���bG���Z�D�v�s [�"��N�# Ѡ�@)�����h'&%�(�)��c�ͼA ���zUZjLRyu�P̤� ��� �W��e�@1'�(��u-nG��p��2_�� T&�6+� _� d�(1Z�E@���h�F�z �~x�fG���s�b�/-+�@��0�%��6�wu�=��z���Y�0...

How to format a text file just like the RFC-text files?
I want to make some document go like these, what tools can help? Any help would be nice, thanks! BLIOGRAPHY ........................................... 34 APPENDIX A. EXAMPLES ............................................... 36 B. SIMPLE FIELD PARSING ................................... 40 C. DIFFERENCES FROM RFC #733 .............................. 41 D. ALPHABETICAL LISTING OF SYNTAX RULES ................... 44 August 13, 1982 - i - RFC #822 ^L Standard for ARPA Internet Tex...

How do I tell the difference between the end of a text file, and an empty line in a text file?
Python's lack of an EOF character is giving me a hard time. I've tried: ----- s = f.readline() while s: .. .. s = f.readline() -------- and ------- s = f.readline() while s != '' .. .. s = f.readline() ------- In both cases, the loop ends as soon it encounters an empty line in the file, i.e. xxxxxxxxxx xxxxxxxxxxx xxxxxxx < - - - loop end here xxxxxxxxxxxxxx xxxxxxxxxx x < ---- loop should end here walterbyrd wrote: > Python's lack of an EOF character is giving me a hard time. > > I've tried...

Web resources about - redirect text to file; text widget - comp.lang.tcl

Asteroid Redirect Mission - Wikipedia, the free encyclopedia
The Asteroid Redirect Mission ( ARM ), also known as the Asteroid Retrieval and Utilization ( ARU ) mission and the Asteroid Initiative , is ...

What percentage of PageRank is lost through a 301 redirect? - YouTube
Roughly what percentage of PageRank is lost through a 301 redirect? Sam Harries, Exeter, United Kingdom Have a question? Ask it in our Webmaster ...

CloudFlare boss’s Gmail hacked in redirect attack on 4Chan
Content distribution network CloudFlare reset all its customer API keys over the weekend after its CEO’s personal and corporate Gmail was breached ...

Parramatta shootings: We need to redouble our efforts to redirect all at-risk teens from a destructive ...
He was too young to drive, and too young to vote. We may discover why he killed, but we may not. What we can do is boost our efforts to divert ...

Parramatta shootings: We need to redouble our efforts to redirect all at-risk teens from a destructive ...
He was too young to drive, and too young to vote. We may discover why he killed, but we may not. What we can do is boost our efforts to divert ...

Budget 2015: Generic drug prices expected to fall as Government redirects health spending
Patients will benefit from a significant drop in the price of many common drugs with changes due in next week's budget.

Defence review aims to redirect $1B a year in spending
The Department of National Defence today launched a top-down review of how it manages its back office with a goal of finding about a billion ...

Redirect Permanent
Just a little note to tell you this blog has now completely moved to its new home. I hope you find it nicer, especially more mobile-friendly. ...

Colorado governor candidate redirects volunteers to Douglas County races
KUSA-Republican gubernatorial candidate and current Colorado Secretary of State Scott Gessler is wading into a local school board election. ...

China’s ‘Great Cannon’ Uses DDoS Style Redirects for Censorship
... the great firewall works to block traffic by terminating links; it can’t alter the traffic, just stop it. The great cannon modifies and redirects ...

Resources last updated: 2/24/2016 3:49:33 PM