Skip Menu |

This queue is for tickets about the Tk-MarkdownTk CPAN distribution.

Report information
The Basics
Id: 104340
Status: open
Priority: 0/
Queue: Tk-MarkdownTk

People
Owner: Nobody in particular
Requestors: turnerjw784 [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.07
Fixed in: (no value)



Subject: Sample program in "Synopsis" does not even work
Installed Tk::MarkdownTk, tried to run the sample program given: #!/usr/bin/perl use Tk; use Tk::MarkdownTk; my $mw = new MainWindow(); my $mdt = $mw->MarkdownTk(); $mdt->insert(q{ some markdown here with tags like this: <Tk::Button -text="Click me!"> }); This produced: Use of uninitialized value $markdown in substitution (s///) at /usr/local/share/perl/5.20.2/Tk/Markdown.pm line 168. Regards, Jim
On 2015-05-11 01:58:20, TURNERJW wrote: Show quoted text
> Installed Tk::MarkdownTk, tried to run the sample program given: > > #!/usr/bin/perl > > use Tk; > use Tk::MarkdownTk; > > my $mw = new MainWindow(); > my $mdt = $mw->MarkdownTk(); > > $mdt->insert(q{ > some markdown here > > with tags like this: <Tk::Button -text="Click me!"> > }); > > > This produced: > > Use of uninitialized value $markdown in substitution (s///) at > /usr/local/share/perl/5.20.2/Tk/Markdown.pm line 168.
I guess that Tk::MarkdownTk is a Tk::Text-derived widget, and therefore needs a position as first argument. This could work: $mdt->insert('end', 'Some markdown ...')
Confirmed, Looks like that reduces this bug down to a doc. issue. The "synopsis" simiply needs to be changed to something like this: use Tk; use Tk::MarkdownTk; my $mw = new MainWindow(); my $mdt = $mw->MarkdownTk(); $mdt->insert('end', q{ some markdown here with tags like this: <Tk::Button -text="Click me!", -command="exit (0);"> }); $mdt->pack(); MainLoop;
Subject: MarkdownTk.pm.diff
30,31c30 < use Tk; < use Tk::MarkdownTk; --- > #!/usr/bin/perl 33,34c32,33 < my $mw = new MainWindow(); < my $mdt = $mw->MarkdownTk(); --- > use Tk; > use Tk::MarkdownTk; 36,37c35,36 < $mdt->insert(q{ < some markdown here --- > my $mw = new MainWindow(); > my $mdt = $mw->MarkdownTk(); 39,40c38,46 < with tags like this: <Tk::Button -text="Click me!"> < }); --- > $mdt->insert('end', q{ > some markdown here > > with tags like this: <Tk::Button -text="Click me!", -command="exit (0);"> > }); > > $mdt->pack(); > > MainLoop;