Tk-MarkdownTk
view release on metacpan or search on metacpan
lib/Tk/MarkdownTk.pm view on Meta::CPAN
elsif($string =~ /<\?(.*)\?>/s){
$self->delete($s,$e);
eval("$1");
die "$@ - somewhere in: $1" if $@;
die $@ if $@;
}
}
}
=head2 parseAttrs
A helper function for TransformTk.
=cut
### parse some attributes
sub parseAttrs {
my ($attrs) = @_;
my %attrs = ();
while($attrs =~ /\G.*?([\w-]+)(=""|=''|=".*?[^\\]"|='.*?[^\\]'|=[^"']\S*|)/g){
my ($k,$v) = ($1,$2);
$v ||= 1;
$v =~ s/^=//;
$v =~ s/^(["'])(.*)\1$/$2/;
if($k =~ /^-(?:command)$/){
eval(" \$v = sub { $v }; ");
die "$@ - somewhere in: $v" if $@;
#print "COMMAND: $v\n";
}
$attrs{$k} = $v;
}
return %attrs;
}
=head2 clipEvents
This copied directly from Tk::ROText
=cut
sub clipEvents
{
return qw[Copy];
}
=head2 ClassInit
This is copied directly from Tk::ROText.
=cut
sub ClassInit
{
my ($class,$mw) = @_;
my $val = $class->bindRdOnly($mw);
my $cb = $mw->bind($class,'<Next>');
$mw->bind($class,'<space>',$cb) if (defined $cb);
$cb = $mw->bind($class,'<Prior>');
$mw->bind($class,'<BackSpace>', $cb) if (defined $cb);
$class->clipboardOperations($mw,'Copy');
return $val;
}
=head2 Populate
This is copied and modified from Tk::ROText. The modification is the addition
of a call to setDefaultStyles. That's all.
=cut
sub Populate
{
my ($self,$args) = @_;
$self->SUPER::Populate($args);
}
=head2 Tk::Widget::ScrlMarkdownTk
Copied and adapted from Tk::ROText
=cut
sub Tk::Widget::ScrlMarkdownTk { shift->Scrolled('MarkdownTk' => @_) }
=head1 AUTHOR
jimi, C<< <jimi at webu.co.uk> >>
=head1 BUGS
Please report any bugs or feature requests to C<bug-tk-markdowntk at rt.cpan.org>, or through
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Tk-MarkdownTk>. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Tk::MarkdownTk
You can also look for information at:
=over 4
=item * RT: CPAN's request tracker (report bugs here)
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Tk-MarkdownTk>
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/Tk-MarkdownTk>
=item * CPAN Ratings
( run in 4.155 seconds using v1.01-cache-2.11-cpan-84e82930d8c )