Update: two small changes in Tk/Wizard.pm i.e. require Tk::TextHighlight; and in sub _text_frame .... and I have syntax coloring!

That's not nice :) you're not supposed to edit modules directly. You're supposed to copy _text_frame and change it to suit your needs, one way

$wizard->addPage( sub { MyTextFrame( $wiz ); } ); ... sub MyTextFrame { package Tk::Wizard; ## for DEBUG/WARN/Dumper... my $self = shift; my $args = shift; DEBUG "Enter _text_frame with ", Dumper($args); my $text; my $frame = $self->blank_frame(%$args); if ( $args->{-boxedtext} ) { if ( ref $args->{-boxedtext} eq 'SCALAR' ) { $text = $args->{-boxedtext}; } elsif ( not ref $args->{-boxedtext} ) { open my $in, $args->{-boxedtext} or Carp::croak "Could not read file: $args->{-boxedtex +t}; $!"; read $in, $$text, -s $in; close $in; WARN "Boxedtext file $args->{-boxedtext} is empty." if not + length $text; } } $$text = "" if not defined $text; my $t = $frame->Scrolled( "TextHighlight", -syntax => ( $args->{ -syntax } || 'Perl' ), -background => ( $args->{ -background } || 'white' ), -relief => "sunken", -borderwidth => "1", -font => $self->{defaultFont}, -scrollbars => "osoe", -wrap => "word", )->pack(qw/-expand 1 -fill both -padx 10 -pady 10/); $t->configure( -background => 'green' ) if DEBUG_FRAME; $t->insert( '0.0', $$text ); ## $t->configure( -state => "disabled" ); return $frame; }
the other way is monkeypatching (declaring a subroutine in someone elses package)
$wizard->addPage( sub { $wiz->MyTextFrame; } ); sub Tk::Wizard::MyTextFrame { ...

Can't edit though, and not sure if this breaks something else. Same happens with Tx::CodeText

When a widget is diabled, its disabled :) Remove

$t->configure( -state => "disabled" );
This disabled bit from sub _text_frame looks like a bug in Tk::Wizard, it doesn't make sense to disable ROText, its already read-only :)

In reply to Re: editable text + syntax for addTextFramePage by Anonymous Monk
in thread editable text + syntax for addTextFramePage by rgcosma

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.