rgcosma has asked for the wisdom of the Perl Monks concerning the following question:
For the dialogues in Tk::Wizard, I'd want to replace the r/o textbox with e.g. a Tk::TextHighlight for which I can write my own syntax rules. I am not sure though if this can be sub-classed or requires going back to basic TK widgets. Just writing
surely doesn't work..use Tk::Wizard; use Tk::TextHighlight; my $wiz = new Tk::Wizard; $wiz->addPage ( sub { my $aa = q/return $self->parserError($txt); #for debugging/; $wiz->_text_frame( { -title => 'hmm', -boxedtext => \$aa, -syntax => 'Perl' } )->pack(-expand => 1, -fill => "both"); } );
Update: two small changes in Tk/Wizard.pm i.e. require Tk::TextHighlight; and in sub _text_frame
and I have syntax coloring! Can't edit though, and not sure if this breaks something else. Same happens with Tx::CodeTextmy $t = $frame->Scrolled("TextHighlight" ... syntax => ( $args->{ -syn +tax } || 'Perl' )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: editable text + syntax for addTextFramePage
by Khen1950fx (Canon) on Apr 21, 2011 at 01:00 UTC | |
|
Re: editable text + syntax for addTextFramePage
by Anonymous Monk on Apr 21, 2011 at 01:01 UTC | |
by rgcosma (Beadle) on May 05, 2011 at 08:17 UTC |