f



Text widget: any way to copy while omitting elided text?

Can you suggest a way to copy only the displayed text in the selection, 
omitting any elided text?

-- Russell
0
rowen (125)
10/3/2006 5:06:15 PM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

2 Replies
710 Views

Similar Articles

[PageSpeed] 9

Russell E. Owen wrote:
> Can you suggest a way to copy only the displayed text in the selection, 
> omitting any elided text?
> 
> -- Russell

With "selection handle" you can request that a command be run whenever 
the selection is retrieved. You can then use the "dump" subcommand of 
the text widget to get the text and tag information. Then, you can 
reconstitute the raw data, leaving out all the data with an elide tag.
0
oakley (2075)
10/3/2006 5:29:35 PM
Russell E. Owen wrote:
> Can you suggest a way to copy only the displayed text in the selection,
> omitting any elided text?

Use Tk 8.5 and "$text get -displaychars $from $to"

cheers,

Vince.

0
10/3/2006 10:16:00 PM
Reply:

Similar Artilces:

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...

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 ...

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 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). What would this gain except for bloat? It's not like SQL is utterly compatible with any programming language; users will still have to learn all the operators anyway. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match Peter Eisentraut wrote: >>What is "text + text" supposed to do right now? > > Nothing. Then are these bugs? (7.4.5 and 8.0.0beta1 give same results). Frankly, the current behaviour is quite strange to me. ------------------ =...

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 @ 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 > , }, > ,...

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( > ...

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 Color in Copied Text
I use Mathematica for all my class notes, and occasionally copy things from code editors that use color to highlight different constructs. In an earlier version (probably 5.2) the color highlighting copied over when I pasted it into a Text cell, but now this doesn't happen - all b/w. I don't see any way around this. Any ideas? Thanks, Kevin ...

text question: is text in a range elided?
Is there some easy way (in tk 8.4.x) to tell if text in a given range is elided? ("any text" or "all text" doesn't matter in this case; I'm happy either way). What I'm doing is writing a message log window for a control system. It includes the ability to highlight text (display with a colored background) and filter text (elide it) based on various criteria. This is all done with tags, of course (what a wonderful feature). It also includes buttons to show the next and previous range of highlighted text using "tag nextrange" and "tag prevrange". Unfortunately, these commands find text whether it is visible or elided. This is an issue because: - In some cases elided text may also be highlighted simply because it's much easier to implement that way. - "tag nextrange/prevrange" searches all text, elided or not (it has no "elide" option, unlike the search command). The result is that sometimes pushing the Next or Prev button has no visible effect. So...if I had some way to know if found text was elided, I could repeat the search until visible text was selected. -- Russell Russell E. Owen schrieb: > Is there some easy way (in tk 8.4.x) to tell if text in a given range is > elided? ("any text" or "all text" doesn't matter in this case; I'm happy > either way). I have experimented a bit with an interactive wish: % pack [text .t] (sab) 3 % .t tag config...

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 ..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 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 > > >...

text widget: loading dumped text?
Is there an easy way to reload information dumped from a text widget? I'm trying to reproduce and report a bug in the text widget and this would help a lot. -- Russell P.S. the bug is that in Aqua 8.4.15 if I scroll to the top of the text widget while some text is elided, often a few lines that *should* be displayed are simply blank. It's fairly reproducible but the data is rather complex. Russell E. Owen wrote: > Is there an easy way to reload information dumped from a text widget? > I'm trying to reproduce and report a bug in the text widget and this > would help a lot. > > -- Russell > > P.S. the bug is that in Aqua 8.4.15 if I scroll to the top of the text > widget while some text is elided, often a few lines that *should* be > displayed are simply blank. It's fairly reproducible but the data is > rather complex. What do you mean by "dumped"? Saved? -- Kevin Walzer Code by Kevin http://www.codebykevin.com Russell E. Owen wrote: > Is there an easy way to reload information dumped from a text widget? > I'm trying to reproduce and report a bug in the text widget and this > would help a lot. > It's possible to write code to do this, but there's nothing built-in to Tk or available in tklib. -- Bryan Oakley http://www.tclscripting.com Russell E. Owen wrote: > Is there an easy way to reload information dumped from a text widget? > I'm trying to reproduce and repo...

Text widget
I'm trying to write a text editor with Tk::Text. The Tk::Text widget has a very sophisticated mechanisms using 'tags' for applying formatting (font, size, bold, etc) to the text in the widget. Is there any way to save this formatting when saving the text from the widget to a file? The Tk::TextUndo widget has the Save method - but it strips all tags out and just saves the plain text. I presume one needs a markup language of some sort to represent the tags - and when reading the file back in you apply the tags again. So ... a rich text widget in Tk? Any fancy wa...

Replace text with image in text widget
I'm trying to replace an emoticon with an actual image in a text widget. I know I'm not doing this correctly: the sample code below inserts two images randomly and seems to garble the text in other ways. The idea is to have two emoticons (one on each line) and replace them with an image, nothing more. Can anyone take a look and suggest how I might get this to work? Thanks. --- SPfHZvvOGvfQEvfGdvjQE/rNMfrOMfrNPfvQHfzQHfjQLfrNRvjQL/vRJfzRJvrOWvbMh/3VHPfM h/3WHPzVMP7XF/zVMfrPdv7YGP7YG/7YHPzWPPzWPfvUVP7ZHf7ZIPvWVf7aJv7aJ/7bJv7bM/7b NP7cLf7dMPvXeP7dNvrVlv7eOPrWlvvaevrYmP7gRP7gRf7gRv7iTf7iWf7jUf3hav7jVv7jV/7k YP7lYfzioPzjn/zjoP7ocvzkoP7oc/7pcf7pcvzlp/7pe/7pfP3mp/7si/7tjf/tkf/tkv7uj/3r tf3stf/voP/vo//woP/wof/wpf/wp/7xuf7xvP/zqv7xwf/zq/7yuf/zsP/zsf/zsv7yv//zs/7y xP/zuf/zu//1vP70zv/2vP/2wv/2w//3wv/20P/3zf/3zv/30P/4zv/5z//51P/51f/61f/61v/5 4v/63v/64v/73//85v/85//87f/87v/98v/+9v////////////////////////////////////// /////////////////////////////////////////////////////yH+GkNyZWF0ZWQgd2l0aCBH SU1QIG9uIGEgTWFjACH5BAEKAP8ALAAAAAAWABYAAAj+AP8JHEiwoMGDA3cUMfID4UEZVlBB+/YN miosNxwKHAIrXLlz6NCdMxduVhKHQXJVs7YN3Dhy4rhdw6bryMEYqYL9QiYtWzdv2qYtA2aMFQ6D YIg5s9Xr2DNq1KIl83WrGTM3BU9YEsYrFq0ID4YVczChlqxdyjaxIAhj0ahQplYZGIALl4ADrU6F GuWoBsEZcwRJ6kQKiA9Xr3oAKfVpEiE6OQi+4GLnz6NLnUCJEgXKUyZIge58oUEQRRU2FeAcekSp UiVKkRDJobDmiguCJJ6QgaKgySBGjRoxMtRkQZQxUkoQBEGECxshBBho4MGDQ4MCQth4QRKCYAYb U8JosNGDIUEAAAgw4GEThoqODQVFMMkiBg2bPYkU8XmDRkwXJyMclIIWaZhxRhlkkFHGGWa0scUK CEGgghqF9JFHHXXk0UchcbQggU...

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 a file from another widget > (button, etc.). Thanks set data [.textwidget get 1.0 end-1c] -- Bryan Oakley http://www.tclscripting.com On Sat, 01 Jul 2006 22:27:42 GMT Bryan Oakley <oakley@bardo.clearlight.com> wrote: > 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 a file from another widget > > (button, etc.). Thanks > > set data [.textwidget get 1.0 end-1c] > > -- > Bryan Oakley > http://www.tclscripting.com Thanks Bryan! That works. ...

Tk text search and elided text
All, I'm having trouble understanding the following text widget behavior. I'm using Tcl/Tk 8.4.9. I've got a text widget with some elided text. A search returns the position L.C (properly), but a subsequent search starting at L.C for the same string fails to return L.C. However, a search with the option -elide does return L.C. The elided text is at the beginning of the line, a good 60 characters before the text in question. Here's the example: # -------------------------------- end toplevel .bfw pack [set t [text .bfw.t]] -expand 1 -fill both set elidetext "to elide" $t tag configure toelide -elide 1 $t insert end "random\n" $t insert end ${elidetext} toelide "something here missing instantiation\n" $t insert end ${elidetext} toelide "other text missing instantiation\n" puts [set res [$t search inst 1.0]] # prints 2.62 - proper starting point for 'inst' puts [$t search inst $res] # prints 3.57 - second occurrence of 'inst' puts [$t search -elide inst $res] # prints 2.62 - first occurrence of 'inst' # -------------------------------- end Am I doing something wrong? Is there some expectation I shouldn't have? I figured that all 3 searches should return 2.62. thanks, TJ bigfaceworm wrote: > All, > > I'm having trouble understanding the following text widget behavior. > I'm using Tcl/Tk 8.4.9. > ...

copy text-widgets
Hello! Is there a 'easy' way to copy the content on a text widget to a other text widget? (including tags ...) Thank, Matthias -- -------------------------------------------------------------------- Matthias Meier mailto:meier@fuh.de Fornoff und Heintzenberg GmbH Telefon: +49 (0)7665 937-0 Am Laidh�lzle 9 Fax : +49 (0)7665 937-150 D - 79224 Umkirch -------------------------------------------------------------------- "M. Meier" wrote: > Is there a 'easy' way to copy the content on a t...

how to change foreground color of text in text widget
hi, i have a program in which i am reading from a file and displaying contents of file in a text widgets now on a particular event i read one line of text widget & i need to change color of that line same as it occurs during debugging a program what i feel a tag has to be created suppose .t is my text widget ..t tag configure color1 -foreground red now how do i change color of the line which i have read and how to use this tag if so now i am able to do that what i did is while inserting line in text widget i added diff tag names to each line and while reading each line i configured tag of that line with diff color ...

Using Control-a to select all text in a text widget
I'm having a difficult time binding Control-a so it selects all the text in a widget just like the default Control-/ binding does. I've tried: ..t bind <Control-a> [.t bind <Control-/>] But [.t bind <Control-/>] returns nothing. If I do: ..t bind <Control-/> {puts "Selecting all"} ..t bind <Control-a> [.t bind <Control-/>] When I hit Control-/ I get at the prompt "Selecting all" and all the text is selected. But when I hit Control-a all I get is the "Selecting all" at the prompt and no text is selected. I've also tried: ..t bind <Control-a> {.t tag add sel 1.0 end} And that doesn't work either. In fact, with this code if you do Control-/ and then Control-a it unselects everything. And dumping the tags for the entire region show the tagon/tagoff for sel are gone. Does anyone know the semantics of Control-/? There's got to be more to it. - Ian I've just found this thread: http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/5c1df73696e94962/38ec894e32bafcd2?lnk=gst&q=select+all&rnum=8#38ec894e32bafcd2 Which seems to suggest there's nothing fancy about Control-/. - Ian And to answer my own question, the following works: bind .t <Control-a> {%W tag add sel 1.0 end; break;} - Ian On Wed, 01 Aug 2007 16:54:06 -0000, sniff.scratch@gmail.com wrote: >I'm having a difficult time binding Control-a so it selects all the >text in a w...

Text Widget: Highlighting search terms with the text.
I'm writing a little application to search through data. I would like to be able to go through the text displayed in the Text Widget and highlight (change the colour or bold) the words which were used as the search term. In this little example, I would like to use the highlightText sub to bold the word "line" throughout the Text Widget. Is this possible? use Tk; my $mw = MainWindow->new(-title => 'Hymns GUI'); my $but1 = $mw -> Button(-text => 'Insert Text', -command => \&insertText)->pack(-side =>...

How do I Copy an error message to a text document, as text?
How do I Copy an error message to a text editor document (BBEdit, to be specific) as just plain text (what I see in the notebook cell)? I think I've now tried every possible Copy and Copy As . . . option in the Mac front end menus for Mathematica 4.2, with the text selected and with the cell bracket selected; and every one of them (fourteen cases in all) gives me a messy version of the error message with a bunch of formatting markup stuff inserted. Frustrating!!! Seigman: Yasvir was correct in copying Input and Output Forms to plaintext. However, that is not the M...

text 2 text
I'm rather new to ustation and am having trouble finding replacements for all of my Acad lisp routines. One that I'd like to find changes a selected text string to read like the second selected text string. I realize this can all be done in the text editor but it's not all that quick. Does anyone know of a macro or mdl which can handle this task? Thanks in advance.---Calvin I don't know of any application that will do what you describe, but have you looked at Edit > Find/Replace text? You may also find Bentley's discussion groups of assistance. Over there you can meet other users of Bentley products, exchange ideas, and discuss a wide range of technical subjects. These groups are an excellent technical resource for all users of Bentley products and services. Hope to see you there! For more information take a peek at this page: http://selectservices.bentley.com/discussion/index.htm -- Best Regards, Inga Morozoff [Bentley] www.askinga.com "jgonzales24" <jgonzales24@cox.net> wrote in message news:xcLMb.13975$zs4.2376@fed1read01... > I'm rather new to ustation and am having trouble finding replacements for > all of my Acad lisp routines. One that I'd like to find changes a selected > text string to read like the second selected text string. I realize this > can all be done in the text editor but it's not all that quick. Does anyone > know of a macro or mdl whi...

Text from required text box to read-only text box
Hello, I am fairly new to JavaScript and its use in Acrobat Professional. My situation is this: I have a form with a text box field which is required for the user to enter his/her name. I would like the required text box to display the name in all caps. I also need the user's name to appear in a read-only text box later in the form, which I would like to have the first letter of the user's first, middle initial, and last names to be capitalized. I would also like to have all required fields on the form highlighted in yellow, but the highlighting not printed. Lastly, I would like the...

Surrounding text with text
I was wondering if it was possible to surround a text body with text like so: +--------------+ |ABCDEFGHIJKLM | |H N| |A Main Body O| |L Text goes P| |B here Q| |-=+_ZYXWVUTSR | | | | | | | | | +--------------+ This seems far-fetched, but just curious. I suppose that I could just move stuff around by hand in the GIMP later on, but there's probably a {better,more {extensible,clean}} way of doing it from (La)TeX. -FreeSmith ptjm@interlog.com (Patrick TJ McPhee) wrote in message news:<bffbhe$per$1@news.eusc.inter.net>... > Peter Flynn had an example like that, which he either posted here or > posted a link here. It was something to do with a certificate -- try > searching for his name and that word in google. > > It wouldn't be hard to do with metapost. I have a macro called `pathalong' > which puts text along an arbitrary path. Well, it's been a while, but I finally finished it. It's a little job I was doing for an upcoming wedding. At any rate, I used pstricks to make the text go along a path, along with a couple of hacks for sizing (from graphicx) and kerning along the line (from soul). Here's the code (don't laugh): CAUTION:THIS CODE MAY MAKE YOU WRETCH ---SNIP--- \documentclass{article} \usepackage{graphicx} \usepackage{pstricks,pst-text,nopageno} \usepackage[width=8.5in]{geometry} \usepackage{soul} \begin{document} \thispagestyle{empty} \set...

How to create some text widgets like text editor in VC++?
If create text editor use notebook widget, each text in the pages of the notebook can not be resized, and there is only one text visual each time. Now I want to create text editor like VC++' text, texts can be resized, and they can be dragged at will, and one or more can be visual. Could you tell me how can I do that? Thanks! "sunnyboyGuo@gmail.com" wrote: > > If create text editor use notebook widget, each text in the pages of > the notebook can not be resized, and there is only one text visual each > time. Now I want to create text editor like VC++' text, texts can be > resized, and they can be dragged at will, and one or more can be > visual. > Could you tell me how can I do that? > > Thanks! I am not sure what you mean by the "notebook widget", but could it be that you have created the GUI without any consideration of resizing? I mean: pack [text .t] -fill both will not produce a text widget that gets resized automatically. You would have to do: pack [text .t] -fill both pack configure .t -expand 1 This will instruct [pack] to resize its child widgets that you have so marked. With [grid] it works in a slightly different way: rows and columns are assigned a weight, indicating how much they will change when the window gets resized. Multiple windows are easy to get: either create a new toplevel or create multiple widgets in the same toplevel window: pack [text .t] [text .t2] -fill both If you mean you wa...

Web resources about - Text widget: any way to copy while omitting elided text? - comp.lang.tcl

NSW Police accused of targeting poorer drivers by omitting cocaine swab from roadside tests
Why are roadside police not testing for a drug commonly associated with wealth?

Police deny omitting evidence
Police who saw the Redfern teenager Thomas 'TJ' Hickey moments before he was impaled on a fence discussed the evidence they would give before ...

GM to stop omitting truck-part weights to maximize payload ratings
GM said today that it will no longer omit the weights of some parts when weighing pickups to boost their maximum payload ratings.

Microsoft admits to omitting Windows Phone 8 features because it ‘ran out of time’
There’s a good argument to make that Windows Phone 8 doesn’t need a central notification system because it has live tiles to display incoming ...

Tracy High School Student Disciplined For Omitting ‘Under God’ From Pledge Of Allegiance
... and force that on other people,” district spokesman Sam Strube said. TRACY (CBS13) — A Tracy high-school student is in hot water after omitting ...

Bill Cosby biographer sorry for omitting sexual assault allegations
Mark Whitaker says he was wrong not to "aggressively" look into the charges and promised to address them "at the appropriate time"

Gov. McDonnell apologizes for omitting slavery in Confederacy proclamation - CNN.com
Virginia Gov. Bob McDonnell apologized Wednesday for leaving out any reference to slavery in his recent proclamation designating April as Confederate ...

Apple criticized for omitting factory workers from cash pile
A watchdog group issued a renewed call for Apple to address what this group considers poor working conditions for factory workers in China, criticizing ...

Fox News Uses 9/11 to Falsely Attack Obama for Omitting God
Click here to view this media The hosts of Fox & Friends took advantage of the 11th anniversary of Sept. 11, 2001 on Tuesday to accuse President ...

Cummings redacts key details from letter accusing Issa of omitting Fast and Furious facts
Cummings redacts key details from letter accusing Issa of omitting Fast and Furious facts

Resources last updated: 3/13/2016 3:20:22 PM