f



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
0
11/10/2008 10:38:04 PM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

4 Replies
1099 Views

Similar Articles

[PageSpeed] 41

bigfaceworm wrote:
> 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

FYI,
   Tried on XP with 8.5.3
works fine: same answer all 3 times

Bruce
0
11/10/2008 10:55:20 PM
On Nov 10, 2:55=A0pm, Bruce <doNOTmai...@example.com> wrote:
> > 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. =A0A 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. =A0The elided text is at the beginning of the
> > line, a good 60 characters before the text in question.
   ....
> FYI,
> =A0 =A0Tried on XP with 8.5.3
> works fine: same answer all 3 times

This was something corrected and noted in the changes for 8.5.  The
text widget updates were too vast to backport for 8.4.

Jeff
0
jeff.hobbs (444)
11/11/2008 2:00:56 AM
bigfaceworm wrote:
> I'm having trouble understanding the following text widget behavior.
> I'm using Tcl/Tk 8.4.9.

Upgrade to 8.5. Many things were fixed then, and there's no way that
we want to backport due to the substantial internal changes.

Donal.
0
11/11/2008 11:34:26 AM
On Nov 10, 6:00=A0pm, Jeff Hobbs <jeff.ho...@gmail.com> wrote:
> This was something corrected and noted in the changes for 8.5. =A0The
> text widget updates were too vast to backport for 8.4.

Thanks for the info.  I'll just work around it for now (upgrading is
not an option unfortunately).
Something to look forward to.


TJ
0
11/11/2008 8:54:07 PM
Reply:

Similar Artilces:

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

Carrying out a full-text search, but without the full-text search...
Hi everyone. I have a fairly simple question, but the answer is likely to be very complex. I would like to create a wiki that will allow full-text searches. However, as you know, full-text searches in a large database is very CPU intensive. I need to look into what options are available in the way of breaking everything down into keywords, and how I'd do it efficiently. I know that there is no definitive answer to my query, but I have no idea where to start looking. I would like to make my wiki very much like a small-scale search engine. Much like Google, but far, far smaller by compariso...

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

Database vs Text for text search
At what level a database will be better for a read only text search? I have some records, each has 6 fields. Each record has a pararent record. Each parent has less than 100 childs. Total records is about 1000-1500. I want to put everthing in one single file, or put each parent and their children in a file so I can have 20-30 files. I am afraid to go to the database route, because the limitation of concurent connections and the overhead of database search. Is there a cut-off number of records, below that line, text is better, above it, database is better? "http://links.i6networks...

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

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

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

How to search list of particular text values into free text
Hi All, Please if anyone has idea about how to search particular list of text values from one small table to free text variable in large dataset and when finds the value, update the large dataset. I have small lookup table (around 120 records) for example: Category Types; Type_1 Mangos, Type_1 Pineapples, Type_2 Onions, Type_2 Tomatoes, … Type_n typeN. Now I need to search each particular text values (variable-Types) from the above small table into my large dataset which has free text variable called “Order_details”. For example: Order_details: The last order was for the Mangos on Nov 11...

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

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

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 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. Russell E. Owen wrote: > Ca...

Re: How to search list of particular text values into free text
On Mon, 18 Jun 2007 12:02:45 -0400, SUBSCRIBE SAS-Nim Pat <Npp1129@GMAIL.COM> wrote: >Hi All, >Please if anyone has idea about how to search particular list of text >values from one small table to free text variable in large dataset and >when finds the value, update the large dataset. >I have small lookup table (around 120 records) for example: >Category Types; > >Type_1 Mangos, >Type_1 Pineapples, >Type_2 Onions, >Type_2 Tomatoes, >… > >Type_n typeN. > > >Now I need to search each particular text values (variable-Types) from the >...

Re: How to search list of particular text values into free text #3
This one may not be efficient when look up table are big, but at least it saves your typing: proc sql; create table xx as select distinct a.srno,a.order_details, max(case when a.order_details contains trim(b.types) then b.types else '' end) as btype from large_table a, smalltable b group by a.srno order by a.srno ; proc print; run; Srno Order_details btype 1 The order of Mangos .. Mangos 10 Retured all Potatoes .. Potatoes 2 The returned order .. Mangos 3 Order for the Oranges .. ...

Re: How to search list of particular text values into free text #2
Sorry, there was a minor error, b.types should be b.category: proc sql; create table xx as select distinct a.srno,a.order_details, max(case when a.order_details contains trim(b.types) then b.category else '' end) as btype from large_table a, smalltable b group by a.srno order by a.srno ; proc print; run; Srno Order_details btype 1 The order of Mangos .. Type_1 10 Retured all Potatoes.. Type_2 2 The returned order .. Type_1 3 Order for the Oranges .. Type_1 4 new container for the Onions .. Type_2 5 Boxes o...

Search a Text-String for two possible outputs result strings embedded in the text.
I am trying to search a string that outputs result as "Sucess" or "Failure". I am configuring a device using command prompt, and I get a text based result as shown on the front panel after the configuration has been done successfully, namely the following: &nbsp; C:\SHOAB\HCE-ME_Functional_Tester\LABVIEW_DEVELOPMENT\DIGI-ME-FCT\ConfigLoad&gt;connectprog /upload /destip=192.168.192.211 /config=C:\SHOAB\HCE-ME_Functional_Tester\LABVIEW_DEVELOPMENT\DIGI-ME-FCT\ConfigLoad\ME211Prod.rci /username=root /password=dbps /reboot Digi Connect ProgrammerVersion 1.3.19.0Copyrig...

Text/C editor written in Tcl/Tk
Dear all, I have used the Tk text widget for some time. It is the most powerful text widget I have ever seen. My feeling is that it should not be very difficult to build a great editor out of it. I am currently using jEdit which is written in Java. Is there any editor written in Tcl/Tk written that is comparable to jEdit, Emacs, Vim existed some where? I checked Google and was unable to find one. Thanks a lot! Best regards, Jingzhao ouj wrote: > Dear all, > > I have used the Tk text widget for some time. It is the most powerful text > widget I have ever seen. My feeling is ...

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

tcl/tk 8.4 text widget question
Hi! Can you help. I have a gui script that displays the output of commands as they are ran in a text widget with scroll bar. However, once the output goes past the height of the text widget, the text does not automatically scroll down. When the processing is complete, I have to scroll to the bottom to see the last few lines including the line where it says "Processing complete" Does anyone know how to fix this? Meg Cooper mulkey_mouse@cox.net wrote: > Hi! > Can you help. > I have a gui script that displays the output of commands as they are > ran in a text widget with scroll bar. However, once the output goes > past the height of the text widget, the text does not automatically > scroll down. When the processing is complete, I have to scroll to the > bottom to see the last few lines including the line where it says > "Processing complete" > > Does anyone know how to fix this? > Meg Cooper Try... $txt see end .... after you add each new line of text. Jeff Hey!! Thanks!! It worked like a charm. ---------- Forwarded message ---------- From: Jeff Godfrey <jeff_godf...@pobox.com> Date: Feb 25, 12:32=A0pm Subject: tcl/tk 8.4 text widget question To: comp.lang.tcl mulkey_mo...@cox.net wrote: > Hi! > Can you help. > I have a gui script that displays the output of commands as they are > ran in a text widget with scroll bar. However, once the output goes > past the height of the text widget, the tex...

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

Tcl/Tk text widget article in Linux Journal
Linux Journal have just published an article I wrote on the Tk text widget. None of the seasoned veterans on c.l.t will learn anything from it, but newbies might find it useful. The information should apply to Windows users too. The link is: http://www.linuxjournal.com/article.php?sid=7357&mode=thread&order=0 This is the first Tcl article (or indeed, any article) I've had published, so I'd welcome any constructive feedback - both on my writing and my Tcl coding. More importantly, this is the first Tcl based article that Linux Journal have published. When I made the original...

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 search
Hi * following situation a table with a column ID varchar2(4000) I want to search with an ID-Range like select * from table where id between '12' and '1234AABBG' Does this work and what about NLS- dependent information ? Thanx for your help Ralph Ralph schreef: > Hi * > > following situation > > a table with a column ID varchar2(4000) > > I want to search with an ID-Range like > > select * from table where id between '12' and '1234AABBG' > > Does this work and what about NLS- dependent information ? > No - what whould be "in between" ?!? Look up NLS_SORT in the manual at tahiti.oracle.com -- Regards, Frank van Bortel Top-posting is one way to shut me up... Frank van Bortel wrote: > Ralph schreef: > >> Hi * >> >> following situation >> >> a table with a column ID varchar2(4000) >> >> I want to search with an ID-Range like >> >> select * from table where id between '12' and '1234AABBG' >> >> Does this work and what about NLS- dependent information ? >> > > No - what whould be "in between" ?!? > > Look up NLS_SORT in the manual at tahiti.oracle.com > Assume id has value of 12NNXXXXX where NN are numbers and XX are chars. the between should define a range of all Id's "between" 12 amd ...

How To Search Text For * or ?
Slightly OT, however: How can I search text for a * or any other wildcard character. On Mon, 13 Sep 2004 17:10:14 +0100, "Strand" <strand@home.com> wrote: >Slightly OT, however: >How can I search text for a * or any other wildcard character. Do you mean within a string? Debug.Print Instr( 1, "This is a * test.", "*" ) should yield: 11 which is the character offset of * within the test string. _______________________ Michael B. Johnson ...

Web resources about - Tk text search and elided text - comp.lang.tcl

SEO, Search Engine Optimisation - Website Optimisation
Hit Search Limited - digital marketing agency specialising in search engine optimisation, affiliates, ROI and pay per click. Online marketing ...

SEO & Search Engine News : SEJ
Latest Search Engine News from the Search Engine Journal.

Search Engine Marketing (SEM), Paid Search Advertising (PPC) & Search Engine Optimization (SEO) - Search ...
The authoritative guide to search engine marketing (SEM), search engine optimization (SEO), paid search advertising (PPC) and social media marketing. ...

Search Newz :: Search Engine News
... To Fight Over Paid Links Google prepared a note about a proposal by French lawmakers and backed by French news publsihers, which want search ...

State of Search - Where Search and Social meet up
The fastest growing Search and Social blog covering strategy developments in search and social media

Yahoo! Search - Wikipedia, the free encyclopedia
This article is about the Yahoo! Search Engine . For the corporation, see Yahoo! . For other uses, see Yahoo! (disambiguation) . , the 2nd largest ...

Armed man fled empty-handed after threatening Caltex servo operator at Paralowie - AdelaideNow Search ...
A man wielding a knife has threatened staff at a Paralowie service station but fled empty-handed on Saturday.

Avalanche in Italian Alps kills six, search continues
An avalanche killed six skiers in the Italian Alps on Saturday, making it one of the deadliest to hit the area in many years, a fire department ...

Clive Palmer opens up about Queensland Nickel on ABC TV’s Insiders program - The Courier-Mail Search ...
CLUELESS Clive Palmer has no idea what approvals he needs to keep his Townsville refinery afloat and is dodging calls from State Government officials, ...

Hundreds involved in violent brawls that shut down city streets - DailyTelegraph Search Search
IT WAS fight club in the Sydney CBD as a bloodthirsty mob chased a rolling brawl through the streets.

Resources last updated: 3/13/2016 12:13:34 PM