f

#### textbox... new text... old text... different colors

hello,

is this possible to do using the textbox widget:

i want to show the user a text widget with some text already filled in. and
i want to allow the user to edit the textbox and add in new text. but i
would like the old text and the new text to be different colors.

for. e.g. textbox pops up with text ABCD in color green. user adds EFGH and
it is in red.

saab


 0
intesab (2)
8/28/2003 7:27:05 PM
comp.lang.tcl 23429 articles. 2 followers.

1 Replies
674 Views

Similar Articles

[PageSpeed] 40

Saab Siddiqui wrote:
> hello,
>
> is this possible to do using the textbox widget:
>
> i want to show the user a text widget with some text already filled in. and
> i want to allow the user to edit the textbox and add in new text. but i
> would like the old text and the new text to be different colors.
>
> for. e.g. textbox pops up with text ABCD in color green. user adds EFGH and
> it is in red.

Here's a quick hack that does that; not sure if it meets your needs or
not. It overrides the widget proc with a custom proc that adds one or
more tags to everything that is inserted. In the following example all
"new" text will be in reverse video.

# create a text widget and a scrollbar
text .t -yscrollcommand [list .vsb set]
scrollbar .vsb -orient vertical -command [list .t yview]
pack .vsb -side right -fill y
pack .t -side left -fill both -expand y

# this is how we want all new text to be displayed
..t tag configure new \
-background [.t cget -foreground]  \
-foreground [.t cget -background]

# insert some sample data
set defaultTags {}
..t insert end [join [lsort [info commands]] \n]

# now set the default tag to be "new", so everything
# that gets inserted from now on has that tag
set defaultTags [list "new"]

# override the widget proc so we can intercept all inserts and
# add our default tags
rename .t .t_
proc .t {args} {
global defaultTags
if {[string match [lindex $args 0] "insert"]} { # first arg is "insert", second is the index # all remaining args are pairs of text and tags. # We'll add our default tags to the list of tags set newArgs [lrange$args 0 1]
foreach {text tags} [lrange $args 2 end] { set tags [concat$tags $defaultTags] lappend newArgs$text $tags } set args$newArgs
}
uplevel .t_ $args }   0 bryan1 (353) 8/28/2003 8:13:33 PM  Reply: Similar Artilces: Placement of New Text Above Old Text During REPLY Does anyone know if Eudora can be made to place the new text that is being written on top of (versus the normal below) the original text. This would be very useful when using stationary to respond to email. Thanks! Gary Thomas newshound@thomasland.org Jim H Regards, the page before pasting it there. ctrl-home to move the cursor to the top of You could highlight the new text then press On Fri, 21 Apr 2006 17:48:21 GMT, newshound@thomasland.org (newshound@thomasland.org) wrote: >Does anyone know if Eudora can be made to place the new text that is >being writ... Showing different color texts on a text control in Java Is there a text control in Java that I can use to show texts with different colors at the same time. Like showing a word in Red and another one in blue at the same time on that control. "lrantisi" <lrantisi@gmail.com> wrote in message news:1163103505.154250.325560@k70g2000cwa.googlegroups.com... > Is there a text control in Java that I can use to show texts with > different colors at the same time. Like showing a word in Red and > another one in blue at the same time on that control. > See http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.ht... 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. ------------------ =... 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 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 ... different bits of text in different colors? Is there any way to display different bits of text in a Tk button, label, or menu button widget in different colors? As far as I can tell, the answer is no - you've just got a foreground color and a background color. It looks like the only way to do this would be to use a text widget and get the different colors via tags, which may not work nicely for my purpose. In the alternative, is there a Tcl/Tk internal way to obtain the image corresponding to a character so that one can manipulate the glyph as an image? My reading of the documentation for font and image doesn't reveal anything like this. (Before someone responds that this is a bad idea leading to garishness, I agree that it generally is, but I think that it would be useful for a particular use I have in mind.) Bill -- Bill Poser, Linguistics, University of Pennsylvania http://www.ling.upenn.edu/~wjposer/ billposer@alum.mit.edu According to William J Poser <wjposer@unagi.cis.upenn.edu>: :It looks like the only way to do this would be to use a text :widget and get the different colors via tags, which may not work nicely :for my purpose. It also might not be too bad - have you tried it? :In the alternative, is there a Tcl/Tk internal way to obtain :the image corresponding to a character so that one can manipulate :the glyph as an image? Not anything I've ever heard of - fonts are not images. Perhaps you could write the text on a canvas and then somehow save as a image file? Take a look ... Different text styles in the same text box I am developing a bibliographic database. I am creating a report with bibliographic references like this: - Joyce, Ulysses, London, Penguin Press, 2002. The last string has been obtained by an expression like this: [author] & [text] & [city] & [publisher] & [date] Now there's a problem. I'd like to get different styles for the different fields (ex: italics for the author, underlined for the book title, etc). Is it possible? Thanks in advance Davide If I'm not mistaken there is a rich-text control that comes with VB that would allow you to do this, but I don't t... Show colored text on a text object I have a chat program. The messages sent from users will be shown in different colors. What is the suitable object for that. The object should be scrollable. lrantisi wrote: > I have a chat program. > The messages sent from users will be shown in different colors. > What is the suitable object for that. Questions usually end in a question mark (e.g. '?') please use question marks in future. Most Swing components can render basic HTML, so that is one way to get colored text. For a more serious approach, it is probably better to use a JTextPane/JEditorPane and use a styled ... ZZZZ New text 1/1 New Text Document.txt (1/1) 18 begin 644 New Text Document.txt 26EI:6EI:6B!);2!S<&5C:6%L  end ... ZZZZ New text 1/1 New Text Document.txt (0/1) 18 Wooo hoooo!!!!1 why are you testing here!! use another group please. Ed *** Sent via Developersdex http://www.developersdex.com *** Congratulations.....I think? :-) David Hodgkins, MCSD, MCDBA, MCSE JSTAR Software Solutions 4402 Sweet Cherry Ln. Kalamazoo, MI 49004 www.jstarsoftware.com - Home of AutoCompact for Access Databases 269-382-2931 ... Add new text box after entered text Hello, I have an application that I'm building but I'm getting stuck on a few things. 1. I have a slider to select how many "sections" to have, this will then build a table of text boxes for a title in one column, and in the other column there will be 2 text boxes for an "option name" and "value". (I got this part) 2. When someone finishes entering the title, and one option/value then clicks off of the last box I want to create a new one for that option. If they don't enter a value for both I don't want it to show another group of text boxes. Ques... Input text and take text from different places? I haven't been able to find anything on this, so here goes: Is it possible to be 'puts'ing text to one place on the terminal while 'gets'in from another? I have setup with VT100 control codes a basic layout for my MUD client, with a line of dashes ('-') going across the second from bottom line. I tried setting it up so that the thread that handles input from the MUD moves the cursor (via control codes) to line 22 (above the 'split' line) to add in the MUD output, and then move it back down to 24 so that the user typing sees their commands being typed down b... Add text to a field and keep the old text? I know what I want to do, however I don't now how to do it, or if Im doing it right. Im running an update and I need to add text to a field and keep the text that was already their in order of "new text"+"old text". So I have this query I wrote, however as its a live db I cant chance the mistake. UPDATE users SET levels = 0, mbox = 0, notes = ? + notes WHERE subscription_id = ? LIMIT 1 * Question marks are converted via php to their values. Levi NVM I found what I needed. For anyone else you need CONCAT() On 12 Oct, 16:06, l3vi <ad...@madfrogproductions.c... 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 ... 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...

Different color for text in same textarea ?
Hi, I have a textaera where I have to cxhoose between "Yes" or "No". I'd like to have a Green "Yes", and a Red "No". Is that possible? I tried but failed to do so. "Henri Beyle" <HB@hotmail.com> wrote in message news:mn.dd5b7d94b84e6b87.78129@hotmail.com... > Hi, > I have a textaera where I have to cxhoose between "Yes" or "No". > I'd like to have a Green "Yes", and a Red "No". > > Is that possible? > I tried but failed to do so. I'm not sure what you mean by &quo...

different colored text in a listbox
Hi, I was wondering if we could have listbox (HTML) where the text are colored differently. For example, if the listbox contains Apple, Pear, Banana, then is it possible to have apple displayed in red, Pear in green and Banana in yellow. Any kind of help in this regard would be greatly appreciated. Thanks in advance, Shashank shashank_shetty@yahoo.com (sks) wrote: > I was wondering if we could have listbox (HTML) where the text are > colored differently. In HTML, you can't do such things. You might try CSS, but I wonder what you are trying to achieve. If you ne...

How do I change the colors of Ring texts individually so when it pulls down, I can see each test with different background color?
I have been using LabView for a almost 18 months now. There was no problem which I could not solve with help of all resources available. But, this is one where I am scratching my head since long time now. &nbsp; I would like to change colors of each individual text in Ring control programmatically. I have attached example VI. In this VI, I change background color of ring text, but it changes only the current (active) background color, so when you pull down the whole menu, it shows same default color for all the text background (not even the color I asked it to). Is there anyway I can defi...

text formatting on different sources in an unbound text box
Howdy all, I have an unbound text box in a report with the following control source: =[genus] & " " & [epithet] & " " & [taxa_author] What I am trying to do is italicize the [genus] and [epithet] parts but not the [taxa_author] part. I have played around with this for a while, but to no avail. I can probably write a macro to do it, but was wondering if there was a more straightforward way to accomplish this. Any suggestions would be greatly appreciated. Thanks! Jeff Hollister -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In a normal TextBox the fon...

Pages
I have a titel-textfield over a pic (headline) , text is black, background for text transparent. A second textfield should overlapp the first textline..... When i arrange the second field with the same settings like the first, the first text disappear... How can i do, that the second text overpapps the first, all over the pic. Any help appreciated! Thanks for replies! I am german and hope that the engish speaking people understand my problem! Soory! Gerd In article <611db9e2-b085-4fe5-907a-ca714b0c32dd@m74g2000hsh.googlegroups.com>, hurlebaus <gerd.schenk@freenet.de> wrote:...

Re: Scrolling text: Changing text color, etc.
Even though Paneled and AnimatorElements are not listed options for Animate (and they are highlighted in Red), they nevertheless work (at least on my platform version). This is very fragile since in a future version they could legitimately filter these unsanctioned options. Also, eliminating the appearance of the control requires that the cell be reevaluated for each sequencing of the animation. \$Version 7.0 for Mac OS X x86 (64-bit) (February 19, 2009) Animate[Row[ RotateLeft[ Thread[ Style[ Characters["Calculus III, Pg 109 "], Bold, Red]], c...

Change the color of partial text of a TextBox.
Hello, Someone can post some example of how to change the color of text on the TextBox. I try to use the method bind to capture a event like <b> key press, but I don' found a method to change the color of this letter pressed. It's something like Color Delegator of IDLE, but more simple... Thanks Mauro ...

Web resources about - textbox... new text... old text... different colors - comp.lang.tcl

1968: How Donald Trump channels the spirit of one of America’s most violent years
Younger voters were probably the most shocked by the violent televised scenes at Donald Trump’s canceled Chicago rally on Friday – and the photographs ...

Billie Lourd Will Return With A Larger Role In ‘Star Wars Episode 8’
Billie Lourd was on the red carpet for Fox’s Scream Queens at Paleyfest on Saturday night. We’ll have a full story on Scream Queens later but ...

WWE News: Former World Champion Christian Confirms That He Is Likely Retired
Not having wrestled in a match since March 2014, former WWE World Heavyweight champion Christian said on a recent edition of Talk is Jericho ...

Multiple doctors gave Germanwings co-pilot sick leave certificates before crash
Los Angeles Times Multiple doctors gave Germanwings co-pilot sick leave certificates before crash Los Angeles Times PARIS – Germanwings co-pilot ...

Michelle Le, Giselle Esteban: ID’s ‘See No Evil’ Chronicles Creepy Case Of Missing California Nurse Later ...
Michele Le, the missing nursing student who vanished from a California parking lot and was later found dead, will be the next story presented ...

Watch: ‘Alice Through the Looking Glass’ TV Spot Questions Daylight Saving Time
Was an extra hour stolen this morning? That’s what the new TV spot for Disney’s “Alice Through the Looking Glass” asks after Sunday’s Daylight ...

Ivory Coast Beach Terrorist Attack Leaves At Least 16 Dead in Grand Bassam
An attack at Grand Bassam, a popular Ivory Coast beach resort in West Africa has left 16 – including at least four European vacationers – dead. ...

Kanye West says Justin Bieber hit was his "favorite song of 2015"
Kanye West — beloved by teen girls, teen boys, and multimillionaire hip-hop moguls. West has been relatively silent on Twitter for, say, the ...

Every Quarter Of This Insane Ohio High School Basketball Final Ended On A Buzzer-Beater
Garfield Heights took down St. Ignatius last night in some hot Cleveland Regional Final action to head to the state semifinals. The Bulldogs ...

Unusually widespread flooding across Louisiana, Mississippi
HATTIESBURG, Miss. (AP) — As the Leaf River rose north of Hattiesburg, Mississippi, 26-year-old Rebecca Bruce and her fiancé grabbed what they ...

Resources last updated: 3/13/2016 8:48:43 PM