Re: How to retrieve a text string information



It's a great idea but I forsee three possible obstacles at
implementing it.

1. Users can place any number of such text strings at will. May I tag
all these text strings the same way (using the same tag) ?

2. By rescaling I mean to multiply the single object y-coordinate by
the inverse of the new aspect ratio. The default aspect ratio is 1:1..
The only other choice is 16:9.
Is this possible by retrieving the text strings through their common
tag ?
I do not use the Tk command "rescale" as it does not result in a canvas
whose aspect ratio is 16:9.

3. Should I need to rescale the text strings font as well (possibly
just choosing a smaller font) is this possible by retrieving the text
strings though the tag ?

Thank you very much for your help.
Maura


Uwe Klein wrote:
Hi,

what about "tagging" these text elements during
creation:

$canv create text .... -tags {special_text tagged_for_rescaling ..}
or later
$canv addtag ..

and then do when it is time to rescale:

foreach item [$canv find withtag {tagged_for_rescaling} ] {
# do the rescaling
}

to keep the items on top

$canv raise tagged_for_rescaling

tagging can be used to advantage,
"find withtag" and imho all other ops that accept tags
allow operating on items selected by logigal ops on tags
i.e tagA||tagB works.

look into the canvas manpage: "ITEM IDS AND TAGS"

uwe

.



Relevant Pages

  • Re: How to retrieve a text string information
    ... The default aspect ratio is 1:1.. ... Is this possible by retrieving the text strings through their common ... I do not use the Tk command "rescale" as it does not result in a canvas ... Should I need to rescale the text strings font as well (possibly ...
    (comp.lang.tcl)
  • Re: tag, tag_end in parser
    ... Iam in process of creating pull parser. ... parsing only with strings. ... starting of tag and end of tag. ... properly parsing XML would require writing an LL ...
    (comp.lang.ruby)
  • Re: Stack-based behaviour of Regexes
    ... These are relatively short strings ... and the DOM seems overkill and costly in terms of cycles ... this begins and where the corresponding tag ends (so the index ... If regular expressions can be used to do nested parenthesis then can't a ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Stack-based behaviour of Regexes
    ... These are relatively short strings ... and the DOM seems overkill and costly in terms of cycles ... this begins and where the corresponding tag ends (so the index ... If regular expressions can be used to do nested parenthesis then can't a ...
    (microsoft.public.vb.general.discussion)
  • Re: Stack-based behaviour of Regexes
    ... These are relatively short strings ... and the DOM seems overkill and costly in terms of cycles ... this begins and where the corresponding tag ends (so the index ... If regular expressions can be used to do nested parenthesis then can't a ...
    (microsoft.public.dotnet.languages.csharp)