NAME

Tk::Zinc::Debug - a perl module for analysing a Zinc application.

SYNOPSIS

perl -MTk::Zinc::Debug zincscript [zincscript-opts] [zincdebug-opts]
   
    or
   
use Tk::Zinc::Debug;
my $zinc = MainWindow->new()->Zinc()->pack;
finditems($zinc, [options]);
tree($zinc, [options]);
snapshot($zinc, [options]);

DESCRIPTION

Tk::Zinc::Debug provides an interface to help developers to debug or analyse Zinc applications.

With finditems() function, you are able to scan all items which are enclosed in a rectangular area you have first drawn by drag & drop, or all items which overlap it. Result is a Tk table which presents details (options, coordinates, ...) about found items; you can also highlight a particular item, even if it's not visible, by clicking on its corresponding button in the table. You can also display particular item's features by entering this id in dedicated entry field

tree() function displays items hierarchy. You can find a particular item's position in the tree and you can highlight items and see their features as described above. You can also generate the perl code corresponding to a selected branch. However there are some limitations : transformations and images can't be reproduced.

With snapshot() function, you are able to snapshot the application window, in order to illustrate a graphical bug for example.

Press Escape key in the toplevel of the application to have some help about available input sequences.

If you load Tk::Zinc::Debug using the -M perl option, nothing needs to be added to your code. By default, all the previous specific functions are invoked with their default attributes for each instance of Zinc widget. You can overload these by passing the same options to the command. Note that perl arrays must be transformed to comma separated string. For example: perl -M Tk::Zinc::Debug zincscript -optionsToDisplay '-tags' -optionsFormat row -itemModBtn Control,1

FUNCTIONS

finditems($zinc, ?option => value, ...?)

This function creates required Tk bindings to permit items search. You can specify the following options :

-color => color

Defines color of search area contour. Default to 'sienna'.

-enclosedModBtn => [Mod, Btn]

Defines input sequence used to process "enclosed" search. Default to ['Control', 3]. Mod can be set to undef.

-overlapModBtn => [Mod, Btn]

Defines input sequence used to process "overlap" search. Default to ['Shift', 3]. Mod can be set to undef.

-searchKey => key

Defines input key used to process particular search. Default to 'Control-f'.

tree($zinc, ?option => value, ...?)

This function creates required Tk bindings to build items tree. You can specify the following options :

-tkey|-key => key

Defines input sequence used to build and display items tree. Default to 'Control-t'.

-itemModBtn => [Mod, Btn]

Defines input sequence used to select an item in the application window in order to display its position in the item's tree. Default to ['Control', 2]. Mod can be set to undef.

-optionsToDisplay => opt1[,..,optN]

Used to display some option's values associated to items of tree. Expected argument is a string of commas separated options.

-optionsFormat => row | column

Defines the display format of option's values. Default is 'column'.

snapshot($zinc, ?option => value, ...?)

This function creates required Tk binding to snapshot the application window. You can specify the following options :

-skey|-key => key

Defines input key used to process a snapshot of the zinc window. Default to ['Control-s'].

-verbosity => boolean

Defines if snapshot should print a message on the terminal. Default to true.

-basename => "a_string"

Defines the basename used for the file containing the snaphshot. The filename will be <currentdir>/basename<n>.png Defaulted to zincsnapshot.

AUTHOR

Daniel Etienne <etienne@cena.fr>

HISTORY

Oct 07 2003 : contours of curves can be displayed and explored.

Sep 15 2003 : due to CPAN-isation, the ZincDebug module has been renamed Tk::Zinc::Debug

May 20 2003 : perl code can be generated from the items tree, with some limitations concerning transformations and images.

Mar 11 2003 : ZincDebug can manage several instances of Zinc widget. Options of ZincDebug functions can be set on the command line.

Jan 20 2003 : item's attributes can be edited.

Jan 14 2003 : ZincDebug can be loaded at runtime using the -M perl option without any change in the application's code.

Nov 6 2002 : some additional informations (like tags or other attributes values) can be displayed in the items tree. Add feedback when selected item is not visible because outside window.

Sep 2 2002 : add the tree() function

May 27 2002 : add the snapshot() function contributed by Ch. Mertz.

Jan 28 2002 : Zincdebug provides the finditems() function and can manage only one instance of Zinc widget.