Oeschey, Lars (I/EK-142, extern) wrote:
Well, that's true -- you want "$configtext->get(0.1,'end');", for example.

hm, ok, that worked... but I'm confused now: why 0.1?

Lars
Lars --

Understandable. Me too! From the 'tk::text' doco:

The base for an index must have one of the following forms:

line.char
Indicates char'th character on line line. [which is reverse of the order indicated on the previous line..?? --mh ;-) ] Lines are numbered from 1 for consistency with other UNIX programs that use this numbering scheme. Within a line, characters are numbered from 0. If char is end then it refers to the newline character that ends the line. @x,y
Indicates the character that covers the pixel whose x and y coordinates within the text's window are x and y. end
Indicates the end of the text (the character just after the last newline).

Which, unless I'm completely addled (possible), seems to mean the numbers should read 1.0 -- except, I'm pretty sure, from using it, that the sequence needs to be reversed -- which may be what's said in the second line..??

Snips from a working script, each call to get or delete in a textbox is in the 0.1 order (char 0 on line 1 is what I *thought* I was doing)... & it just works...

----------------------------------

$desc=$textbox->get(0.1,'end'); # grabs the text in a text box.

sub write_com # writes sent string or string of
# all user defined vars to window
{my $text = shift;
if ($text){
$com_tx->configure(-state=>'normal');
$com_tx->delete(0.1,'end');
$com_tx->insert('end', $text);
$com_tx->configure(-state=>'disabled');}

else{
my @lines;
map {push (@lines, $_) if defined $_;}($hr, "\nRoom:", $room, "\nStart:", $time, $timeplstrt, "End:",
$timestop, $timeplstop,"\nTitle:", $tline, "\nCntct:", $cline, "\nFlag:", $flagged);
$com_tx->configure(-state=>'normal');
$com_tx->delete(0.1,'end');
$com_tx->insert('end', "@lines");
$com_tx->configure(-state=>'disabled');};
}
------------------------------

So, I don't know. Perhaps it's addressing in some other way. If I'm not addressing by the character, but by the pixel perhaps? Or, the docs are misleading, or at least, confusing, but, I doubt that's the case... ;-)

-- mike higgins

^ ^
<-|->
(.)__ the world is a big box of paints.
__ __ and others, the canvas we're dealt.
| | - XTC
_/ \_

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to