From da5f89f636c43e0ecf871d8aa3c11e38dd71ea05 Mon Sep 17 00:00:00 2001 From: heytitle Date: Tue, 31 Mar 2015 19:32:45 +0700 Subject: [PATCH 1/2] Use proper Markdown syntax. --- README => README.md | 73 +++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 36 deletions(-) rename README => README.md (66%) diff --git a/README b/README.md similarity index 66% rename from README rename to README.md index 249323d..57416cd 100644 --- a/README +++ b/README.md @@ -1,4 +1,5 @@ -Tk::ObjScanner provides a GUI to scan any perl data including the +#Tk::ObjScanner +provides a GUI to scan any perl data including the attributes of an object. @@ -27,73 +28,73 @@ The scanner recognizes: - tied hashes arrays or scalars - weak reference (See weaken function of Scalar::Util for details) -Pseudo-hashes are deprecated. +**Pseudo-hashes are deprecated** This module was tested with perl5.8.2 and Tk 804.025 (beta). But should work with older versions of perl (> 5.6.1) or Tk. See the embedded documentation in the module for more details. -Note that test program (in the 't' directory) can be run interactively +**Note** that test program (in the 't' directory) can be run interactively this way : +``` perl t/xxx.t 1 - -Comments and suggestions are always welcome. - -Many thanks to Achim Bohnet for all the tests, patches (and reports) he -made. Many improvements were made thanks to his efforts. - -Thanks to Rudi Farkas for the 'watch' patch. - -Thanks to Slavec Rezic for the pseudo-hash prototype. - -Legal mumbo jumbo: - - Copyright (c) 1997-2004,2007,2014 Dominique Dumont. All rights reserved. - This program is free software; you can redistribute it and/or - modify it under the same terms as Perl itself. - - - Dominique Dumont - ddumont at cpan.org - ---------------------------------------------------------------------- -INSTALLATION - - gunzip -c .tar.gz | tar xvf - - cd - perl Makefile.PL - make test - make install - -From github, this module is built with Dist::Zilla. +``` + +###Installation +``` +gunzip -c .tar.gz | tar xvf - +cd +perl Makefile.PL +make test +make install +``` +From github, this module is built with **Dist::Zilla**. You must make sure that the following modules are installed: + +``` Dist::Zilla::Plugin::MetaResources Dist::Zilla::Plugin::Prepender Dist::Zilla::Plugin::Prereqs Dist::Zilla::PluginBundle::Filter +``` On debian or ubuntu, do: +``` sudo aptitude install \ libdist-zilla-plugin-prepender-perl \ libdist-zilla-plugins-cjm-perl \ libdist-zilla-perl - +``` Then run: - +``` dzil build - +``` or - +``` dzil test dzil build +``` +--- +Comments and suggestions are always welcome. +Many thanks to **Achim Bohnet** for all the tests, patches (and reports) he +made. Many improvements were made thanks to his efforts. +Thanks to **Rudi Farkas** for the 'watch' patch. +Thanks to **Slavec Rezic** for the pseudo-hash prototype. + +Legal mumbo jumbo: +Copyright © 1997-2004,2007,2014 **Dominique Dumont**. All rights reserved. + +This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. +**- Dominique Dumont ( ddumont at cpan.org )** \ No newline at end of file From 136d8535d32a8557a289a6b3880bc538bfc989cf Mon Sep 17 00:00:00 2001 From: heytitle Date: Tue, 31 Mar 2015 20:49:12 +0700 Subject: [PATCH 2/2] Correct example code. --- lib/Tk/ObjScanner.pm | 48 +++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/lib/Tk/ObjScanner.pm b/lib/Tk/ObjScanner.pm index 9788a24..f0a0472 100644 --- a/lib/Tk/ObjScanner.pm +++ b/lib/Tk/ObjScanner.pm @@ -603,29 +603,31 @@ Tk::ObjScanner - a GUI to scan any perl data structure or object =head1 SYNOPSIS - # regular use - use Tk::ObjScanner; - - my $scanner = $mw->ObjScanner( -caller => $object, - -title=>"windows") -> pack ; - - my $mw -> ObjScanner - ( - -caller => $object, - -title => 'demo setting the scanner options', - -background => 'white', - -selectbackground => 'beige', - -foldImage => $mw->Photo(-file => Tk->findINC('folder.xpm')), - -openImage => $mw->Photo(-file => Tk->findINC('openfolder.xpm')), - -itemImage => $mw->Photo(-file => Tk->findINC('textfile.xpm')), - ) - -> pack(-expand => 1, -fill => 'both') ; - - # non-intrusive scan style - - # user code to produce data - Tk::ObjScanner::scan_object($mydata) ; - # resume user code + # regular use + use Tk::ObjScanner; + + my $mw = MainWindow->new; + + my $scanner1 = $mw->ObjScanner( + -caller => $object, + -title=>"windows" + )->pack; + + my $scanner2 = $mw->ObjScanner( + -caller => $object, + -title => 'demo setting the scanner options', + -background => 'white', + -selectbackground => 'beige', + -foldImage => $mw->Photo(-file => Tk->findINC('folder.xpm')), + -openImage => $mw->Photo(-file => Tk->findINC('openfolder.xpm')), + -itemImage => $mw->Photo(-file => Tk->findINC('textfile.xpm')), + )->pack( -expand => 1, -fill => 'both' ) ; + + # non-intrusive scan style + + # user code to produce data + Tk::ObjScanner::scan_object($mydata) ; + # resume user code =head1 DESCRIPTION