At 08:18 2001-11-09 -0500, Jonathan Southwick wrote:
I know that if you specify the '-bold => 1' option in creating a font object and using that font in the RichEdit object creation that you can get your text bolded in the RichEdit field. My question is this, is it possible to go back and forth between bolded and unbolded text in a Richedit field?

Working code:

=head2 podAddLine($line, $heading)

Add the $line to the end of the POD text box, using the
$heading level of emphasis.

$heading -- 0 == text, 1 == H1, 2 == H2

Return 1 on success, else 0.

=cut
sub podAddLine { my $self = shift; my $pkg = ref($self);
    my ($line, $heading) = @_;

    my @aFont = (
            -height => $self->rhConfig()->{podFontSize},
            -name => $self->rhConfig()->{podFontName},
            );
    my %hOn = (
            1 => [-color => 0x000000, -bold => 1, @aFont],
            2 => [-color => 0x000000, -bold => 1, @aFont],
            0 => [-color => 0x000000, -bold => 0, @aFont],
            );
    my $rePOD = $self->winMain()->rePOD();

    $rePOD->Select(999999,999999); #Stolen from the PM chatterbox
    $rePOD->SetCharFormat(@{$hOn{$heading}});
    $rePOD->ReplaceSel("$line\n",1);

    return(1);
    }


/J

------ ---- --- -- -- -- -  -   -    -        -
Johan Lindström                    Boss Casinos
Sourcerer                     [EMAIL PROTECTED]
                 http://www.bahnhof.se/~johanl/
If the only tool you have is a hammer,
everything tends to look
like a nail


Reply via email to