copy everything including format from one text widget to another

copy everything including format from one text widget to another

Post by ngoc » Thu, 25 Aug 2005 18:56:28


Hi
I want to copy everything including format(color, large font) from one
text widget to another.

# Copy user selection from input page to output page
sub copy_input_to_output_page {
$fmt_ed_output->insert('end', $fmt_ed_input->get('1.0', 'end'));
$sel_fmt_output->insert('end', $sel_fmt_input->get('1.0', 'end'));
}
do not give expected result, All format is lost

Try another way
# Copy user selection from input page to output page
sub copy_input_to_output_page {
$fmt_ed_output->insert('end', $fmt_ed_input->selectAll);
$sel_fmt_output->insert('end', $sel_fmt_input->selectAll);
}
Error: wrong # args: should be
".notebook.output_data.frame2.frame1.rotext insert index chars ?tagList
chars tagList ...?"
thanks
 
 
 

copy everything including format from one text widget to another

Post by brian » Thu, 25 Aug 2005 21:00:06

ngoc < XXXX@XXXXX.COM > writes:


The documentation for get says that it returns text. Why would you
expect formatting information as well?


Similarly for selectAll.

If you want formatting information (i.e. tags) as well as text, a
quick browse of the documentation indicates that the dump method might
be a good place to start.

HTH

--
Brian Raven
That gets us out of deciding how to spell Reg[eE]xp?|RE . . .
Of course, then we have to decide what ref $re returns... :-)
-- Larry Wall in < XXXX@XXXXX.COM >