aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorlecoanet2006-09-22 13:48:28 +0000
committerlecoanet2006-09-22 13:48:28 +0000
commit4550d023411f40d34d11e7637878c96c5122470d (patch)
tree337bc4998f88996bb306ca5a27f24cc74c5fd7c9 /doc
parentdfe2c7b1846a6cec113c02c1e2e329c885330b7b (diff)
downloadtkzinc-4550d023411f40d34d11e7637878c96c5122470d.zip
tkzinc-4550d023411f40d34d11e7637878c96c5122470d.tar.gz
tkzinc-4550d023411f40d34d11e7637878c96c5122470d.tar.bz2
tkzinc-4550d023411f40d34d11e7637878c96c5122470d.tar.xz
Minor fixes and typographic improvements.
Diffstat (limited to 'doc')
-rw-r--r--doc/refman.cfg4
-rw-r--r--doc/refman.tex273
2 files changed, 153 insertions, 124 deletions
diff --git a/doc/refman.cfg b/doc/refman.cfg
index af203cb..c60bd59 100644
--- a/doc/refman.cfg
+++ b/doc/refman.cfg
@@ -15,13 +15,13 @@
\Css{div.bodylayout { color: \#000000;
padding: 8px; font-family: sans-serif; font-size: 12px; }}
-\Css{a { color: \#043698; text-decoration: none; }}
+\Css{a { color: \#002AAA; text-decoration: none; }}
\Css{a:hover { color: \#A00000; text-decoration: underline; font-style: italic; }}
\Css{.titleHead { background-color: \#FFFFFF; border: 2px \#507BBF solid; padding: 4px; }}
\Css{div.maketitle { margin-bottom: 10px; padding-bottom: 10px; border-bottom-style: groove; }}
\Css{.author { font-weight: bold; }}
\Css{.sectionToc { padding: 6px; }}
-\Css{.subsectionToc { padding: 12px; }}
+\Css{.subsectionToc { padding-left: 12px; }}
\Css{h1, h2 {
background-color: \#E5ECF9;
diff --git a/doc/refman.tex b/doc/refman.tex
index 6e64c18..e36a9af 100644
--- a/doc/refman.tex
+++ b/doc/refman.tex
@@ -71,9 +71,16 @@
{\tt #1}}
\newcommand{\ident}[1] {%
- {\tt\large #1}}
+ {\bf\large #1}}
-\newenvironment{blockindent} {\begin{quote}\vspace{-0.8\baselineskip}} {\end{quote}\vspace{-0.5\baselineskip}}
+\newcommand{\linkface}[1] {%
+ {\bf\large #1}}
+
+\newenvironment{blockindent} {%
+ \begin{quote}\vspace{-0.8\baselineskip}%
+} {%
+ \end{quote}\vspace{-0.5\baselineskip}%
+}
\newcommand{\option}[3]{%
\label{opt:#1}
@@ -92,6 +99,7 @@
{\tt\large #1 {\bf #2} #3}}
\newcommand{\zinccmd}[2]{%
+ \subsection{#1}
\command{pathname}{#1}{#2}}
\newcommand{\mapinfocmd}[3]{%
@@ -109,20 +117,20 @@
}
\newcommand{\attrtyperef}[1]{%
- \hyperref[attrtype:#1]{\ident{#1}}
+ \hyperref[attrtype:#1]{\linkface{#1}}
}
% the following command is never used!!
\newcommand{\available}[1]{%
- \hyperref[obj:#1]{\ident{#1}}
+ \hyperref[obj:#1]{\linkface{#1}}
}
\newcommand{\optref}[1]{%
- \hyperref[opt:#1]{\ident{-#1}}
+ \hyperref[opt:#1]{\linkface{-#1}}
}
\newcommand{\cmdref}[1]{%
-\hyperref[cmd:#1]{\ident{#1}}
+\hyperref[cmd:#1]{\linkface{#1}}
}
%first argument : item type or 'option'
@@ -133,14 +141,14 @@
\label{attribute:#1:#2}
\ident{-#2 }%
\index{#2|hyperpage}
- \hyperref[attrtype:#3]{\ident{#3}}
+ \hyperref[attrtype:#3]{\linkface{#3}}
\begin{quote}\vspace{-\baselineskip}#4\vspace{-0.8\baselineskip}\end{quote}
}
% first argument : item type or 'option'
% second argument: attribute
\newcommand{\attributeref}[2]{%
- \hyperref[attribute:#1:#2]{\ident{-#2}}
+ \hyperref[attribute:#1:#2]{\linkface{-#2}}
}
\newcommand{\object}[1]{%
@@ -153,11 +161,11 @@
}
\newcommand{\objectref}[1]{%
- \hyperref[obj:#1]{\ident{#1}}
+ \hyperref[obj:#1]{\linkface{#1}}
}
\newcommand{\conceptref}[2]{%
- \hyperref[concept:#2]{\ident{#1}}
+ \hyperref[concept:#2]{\linkface{#1}}
}
% Premier parametre : nom du fichier image
@@ -174,7 +182,7 @@
\newcommand{\anurl}[1]{%
- \href{#1}{#1}
+\href{#1}{\linkface{#1}}
}
@@ -1196,21 +1204,21 @@ requires both the SHAPE X11 extension and a compliant Window Manager (fvwm is kn
to support non rectangulaire top windows). The clipping form should have a bounding box
with the same ratio as the topwindow or some normalisation will occur. Example:
-\code{
- use Tk::Zinc;\\
+\begin{verbatim}
+ use Tk::Zinc;
- my \$mw = MainWindow->new();\\
- my \$zinc = \$mw->Zinc(-reshape => 1, -fullreshape => 1)->pack;\\
+ my $mw = MainWindow->new();
+ my $zinc = $mw->Zinc(-reshape => 1, -fullreshape => 1)->pack;
- \# creating a triangulaire curve\\
- my \$triangle= \$zinc->add('curve',1, [ [0,0], [100,0], [50,100] ], -closed => 1);\\
- \# using the triangulaire curve to reshape both TkZinc and Mainwindow widgets\\
- \$zinc->itemconfigure(1, -clip => \$triangle);\\
+ # creating a triangulaire curve
+ my $triangle= $zinc->add('curve',1, [ [0,0], [100,0], [50,100] ], -closed => 1);
+ # using the triangulaire curve to reshape both TkZinc and Mainwindow widgets
+ $zinc->itemconfigure(1, -clip => $triangle);
- \$zinc->add('arc',1, [ [0,0], [100,100] ], -filled => 1, -fillcolor => 'darkblue');
- ...\\
- \&Tk::MainLoop;
-}
+ $zinc->add('arc',1, [ [0,0], [100,100] ], -filled => 1, -fillcolor => 'darkblue');
+ ...
+ Tk::MainLoop;
+\end{verbatim}
%%
@@ -1309,88 +1317,88 @@ group subtree.
A demo called ``Using pathTags'' in zinc-demos may help you better understand pathTags.
Here are some commonly used pathTags idioms:
-\begin{description}
+\begin{itemize}
-\item{\ident{.group1Tag.group2Tag.aTag}}\\
-Selects all {\bf direct} children with the tag \ident{aTag} in the group obtained by
-following the path \ident{.group1Tag.group2Tag} from the root group.
+\item{\ident{.group1Tag.group2Tag.aTag}}
+ Selects all \underline{direct} children with the tag {\it aTag} in the group obtained by
+following the path {\it .group1Tag.group2Tag} from the root group.
The search proceed from the root group to the first direct child group in display
-list order with tag \ident{group1Tag}. Then it searches for the first direct child group
-with tag \ident{group2Tag}. Finally in this group, the search ends by finding all direct
-children items (including groups) with tag \ident{aTag}. If a tag is not found the whole
+list order with tag {\it group1Tag}. Then it searches for the first direct child group
+with tag {\it group2Tag}. Finally in this group, the search ends by finding all direct
+children items (including groups) with tag {\it aTag}. If a tag is not found the whole
search is aborted and no item is selected.
-\item{\ident{.group1Tag.group2Tag*aTag}}\\
-Selects all children, {\bf direct or indirect}, with the tag \ident{aTag} in
-the group obtained by following the path \ident{.group1Tag.group2Tag} from the root group.
+\item{\ident{.group1Tag.group2Tag*aTag}}
+Selects all children, \underline{direct or indirect}, with the tag {\it aTag} in
+the group obtained by following the path {\it .group1Tag.group2Tag} from the root group.
-\item{\ident{.group1Tag*group2Tag.aTag}}\\
-Selects all {\bf direct} children with the tag \ident{aTag} in
-the group obtained by following the path \ident{.group1Tag*group2Tag} from the root group.
+\item{\ident{.group1Tag*group2Tag.aTag}}
+Selects all \underline{direct} children with the tag {\it aTag} in
+the group obtained by following the path {\it .group1Tag*group2Tag} from the root group.
The search proceed from the root group to the first direct child group in display
-list order with tag \ident{group1Tag}. Then it searches in display list order down the
-hierearchy for the first group with tag \ident{group2Tag} . Finally in this group, the
-search ends by finding all direct children items (including groups) with tag \ident{aTag}.
+list order with tag {\it group1Tag}. Then it searches in display list order down the
+hierearchy for the first group with tag {\it group2Tag} . Finally in this group, the
+search ends by finding all direct children items (including groups) with tag {\it aTag}.
If a tag is not found the whole search is aborted and no item is selected.
-\item{\ident{.group1Tag*group2Tag*aTag}}\\
-Selects all items with the tag \ident{aTag} in the hierarchy
-of the group obtained by following the path \ident{.group1Tag*group2Tag} from the root
+\item{\ident{.group1Tag*group2Tag*aTag}}
+Selects all items with the tag {\it aTag} in the hierarchy
+of the group obtained by following the path {\it .group1Tag*group2Tag} from the root
group. The search proceed from the root group to the first direct child group in
-display list order with tag \ident{group1Tag}. Then it searches in display list order down
-the hierearchy for the first group with tag \ident{group2Tag} . Finally in this group, the
-search ends by finding all direct children items (including groups) with tag \ident{aTag}.
+display list order with tag {\it group1Tag}. Then it searches in display list order down
+the hierearchy for the first group with tag {\it group2Tag} . Finally in this group, the
+search ends by finding all direct children items (including groups) with tag {\it aTag}.
If a tag is not found the whole search is aborted and no item is selected.
-\item{\ident{.group1Tag.group2Tag.}}\\
-Selects all {\bf direct} children of the group obtained
-by following the path \ident{.group1Tag.group2Tag} from the root group. If a tag is not
+\item{\ident{.group1Tag.group2Tag.}}
+Selects all \underline{direct} children of the group obtained
+by following the path {\it .group1Tag.group2Tag} from the root group. If a tag is not
found the whole search is aborted and no item is selected.
-\item{\ident{.group1Tag.group2Tag*}}\\
+\item{\ident{.group1Tag.group2Tag*}}
Selects all items in the hierarchy of the group obtained
-by following the path \ident{.group1Tag.group2Tag} from the root group. If a tag is not
+by following the path {\it .group1Tag.group2Tag} from the root group. If a tag is not
found the whole search is aborted and no item is selected.
-\item{\ident{.groupId.aTag}}\\
-Selects all {\bf direct} children with tag \ident{aTag} of the group with id \ident{groupId}.
-If \ident{groupId} is not found or is not a group id, the search is aborted and no item
+\item{\ident{.groupId.aTag}}
+Selects all \underline{direct} children with tag {\it aTag} of the group with id {\it groupId}.
+If {\it groupId} is not found or is not a group id, the search is aborted and no item
is selected. This form together with the next is specially useful with cloned
items hierarchies where only the topmost group item is known after cloning. Using
pathTags it is now possible to make use of designs using components with named
sub-components. It is possible to clone a component and afterward to change the
behavior of named sub-components with pathTags of the form
-\ident{.componentId.subComponentName} or perhaps better {.componentId*subComponentName} . Some
-care is needed in order to avoid sub-component name clash. Remember that the search for
-tags proceed in {\bf display list order}, not in hierarchy order. In other more
-technical words the search walks the item tree {\bf depth first} not breadth first.
-
-\item{\ident{.groupId*aTag}}\\
-Selects all items with tag \ident{aTag} in the hierarchy of the
-group with id \ident{groupId}. If \ident{groupId} is not found or is not a group id, the search
+{\it .componentId.subComponentName} or perhaps better {\it .componentId*subComponentName}.
+Some care is needed in order to avoid sub-component name clash. Remember that the search
+for tags proceed in \underline{display list order}, not in hierarchy order. In other more
+technical words the search walks the item tree \underline{depth first} not breadth first.
+
+\item{\ident{.groupId*aTag}}
+Selects all items with tag {\it aTag} in the hierarchy of the
+group with id {\it groupId}. If {\it groupId} is not found or is not a group id, the search
is aborted and no item is selected.
-\item{\ident{.groupId.}}\\
-Selects all {\bf direct} children of the group with id \ident{groupId}. It is the only
+\item{\ident{.groupId.}}
+Selects all \underline{direct} children of the group with id {\it groupId}. It is the only
way to get direct children of a group.
-\item{\ident{.groupId*}}\\
-Selects all items in the hierarchy of the group with id \ident{groupId}.
+\item{\ident{.groupId*}}
+Selects all items in the hierarchy of the group with id {\it groupId}.
-\item{\ident{.}}\\
-Selects all {\bf direct} children of the root group.
+\item{\ident{.}}
+Selects all \underline{direct} children of the root group.
-\item{\ident{*}}\\
+\item{\ident{*}}
Selects all items in the hierarchy (not counting the root group itself).
-\item{\ident{.aTag}}\\
-Selects all {\bf direct} children of the root group with the tag \ident{aTag}.
+\item{\ident{.aTag}}
+Selects all \underline{direct} children of the root group with the tag {\it aTag}.
-\item{\ident{*aTag}}\\
+\item{\ident{*aTag}}
Selects all items in the whole hierarchy (starting a the root group)
-with the tag \ident{aTag}. It is the same as using the simple tag \ident{aTag}.
+with the tag {\it aTag}. It is the same as using the simple tag {\it aTag}.
-\end{description}
+\end{itemize}
\section{Tags and bindings}
@@ -1458,7 +1466,7 @@ Indices are used to specify a character position in textual items such as the \o
item. Indices are accepted as parameters by commands managing text: \cmdref{cursor},
\cmdref{index}, \cmdref{insert}, \cmdref{dchars} and \cmdref{select}.
-\begin{description}
+\begin{itemize}
\item{\ident{number}} This should be an integer giving the character position within the
text of the item. The indices are zero based. A number less than zero is treated as zero
and a number greater than the text length is rounded to the text length. A number equal to
@@ -1471,8 +1479,8 @@ item. Indices are accepted as parameters by commands managing text: \cmdref{curs
the selection is not in the item, this form returns an error.
\item{\ident{sel.last}} Refers to the last character of the selection in the item. If the
selection is not in the item, this form returns an error.
-\item{\ident{@x,y}} Refers to the character at the point given by \ident{x} and \ident{y},
- \ident{x} and \ident{y} are interpreted as window coordinates. If the point lies outside
+\item{\ident{@x,y}} Refers to the character at the point given by {\it x} and {\it y},
+ {\it x} and {\it y} are interpreted as window coordinates. If the point lies outside
of the area corvered by the item, they refer to the first or last character in the line
that is closest to the point.
\item{\ident{bol}} refers to the beginning of line
@@ -1481,7 +1489,7 @@ item. Indices are accepted as parameters by commands managing text: \cmdref{curs
\item{\ident{eow}} refers to the end of word
\item{\ident{up}} refers to previous line
\item{\ident{down}} refers to next line
-\end{description}
+\end{itemize}
%%
@@ -1526,7 +1534,7 @@ In this chapter, we first list all commands by categories, then we details each
\item{Named resources} : \cmdref{gname} \cmdref{gdelete} \cmdref{tsave}
-\item{Micellanous} : \cmdref{monitor} \cmdref{postscript} \cmdref{type}
+\item{Miscellaneous} : \cmdref{monitor} \cmdref{postscript} \cmdref{type} \cmdref{collapsemotions}
\end{itemize}
@@ -1579,10 +1587,9 @@ reference) and all list parameters are given as array references.
is 'c' for a cubic bezier control point. For example in Perl/Tk, the following list
is an example of 2 beziers segments with a straight segment in-between:
-\code{
-( [x0, y0], [x1, y1, 'c'], [x2, y2, 'c'], [x3, y3],
- [x4, y4, 'c'], [x5, y5] )
-}
+ \begin{verbatim}
+( [x0, y0], [x1, y1, 'c'], [x2, y2, 'c'], [x3, y3], [x4, y4, 'c'], [x5, y5] )
+ \end{verbatim}
As there is only on control point, \code{[x4, y4, 'c']} , for the second cubic bezier,
the omitted second control point will be defaulted to the same point.
@@ -1766,10 +1773,10 @@ reference) and all list parameters are given as array references.
Returns the \emph{window coordinates} of an item anchor. If no item is named by {\tt tagOrId}
or if the item doesn't support anchors, an error is raised. If more than one item match
{\tt tagOrId}, the topmost in display list order is used.
-\code{
-\# for example to get the lower right corner of a text item\\
-(\$x ,\$y) = \$zinc->anchorxy('myTextTag', 'se');
-}
+ \begin{verbatim}
+ # for example to get the lower right corner of a text item
+ ($x ,$y) = $zinc->anchorxy('myTextTag', 'se');
+ \end{verbatim}
\end{blockindent}
@@ -1880,20 +1887,6 @@ false.
\end{blockindent}
-\zinccmd{collapsemotions}{?boolean?}
-
-{\tt\large \$current = \$zinc->{\bf collapsemotions}(?boolean?);}
-
-\begin{blockindent} This command controls how the motion events are handled by
- the Tk event loop. Pass a boolean true to ask for compression of consecutive
- motion events accumulated in the event queue. Pass a boolean false to suspend
- the compression process. The change affects all the windows opened by the
- application on the same display, so use with care. The command returns the
- previous state as a boolean. If the parameter is omitted the command simply
- returns the current state.
-\end{blockindent}
-
-
\zinccmd{clone}{tagOrId ?attr value ...?}
{\tt\large \$id = \$zinc->{\bf clone}(tagOrId, ?attr=>value, ...?);}
@@ -1910,6 +1903,20 @@ false.
\end{blockindent}
+\zinccmd{collapsemotions}{?boolean?}
+
+{\tt\large \$current = \$zinc->{\bf collapsemotions}(?boolean?);}
+
+\begin{blockindent} This command controls how the motion events are handled by
+ the Tk event loop. Pass a boolean true to ask for compression of consecutive
+ motion events accumulated in the event queue. Pass a boolean false to suspend
+ the compression process. The change affects all the windows opened by the
+ application on the same display, so use with care. The command returns the
+ previous state as a boolean. If the parameter is omitted the command simply
+ returns the current state.
+\end{blockindent}
+
+
\zinccmd{configure}{?option? ?value? ?option value ...?}
{\tt\large @options = \$zinc->{\bf configure}();}\\
@@ -2173,18 +2180,19 @@ false.
This command returns the list of all items selected by {\tt searchCommand} and the {\tt
args}. See the \cmdref{addtag} command for an explanation of {\tt searchCommand} and the
various {\tt args}. The items are sorted in drawing order, topmost first. For example:\\
- \code{ \# to get the item under the mouse cursor:\\
- \$item = \$zinc->find('withtag', 'current');\\
+ \begin{verbatim}
+ # to get the item under the mouse cursor:
+ $item = $zinc->find('withtag', 'current');
- \# to get the closest item of a point:\\
- \$closest = \$zinc->find ('closest', \$x, \$y);\\
+ # to get the closest item of a point:
+ $closest = $zinc->find('closest', $x, $y);
- \# to get direct children of an atomic group with a pathTag:\\
- @children = \$zinc->find('withtag', ".atomicGroup.");\\
+ # to get direct children of an atomic group with a pathTag:
+ @children = $zinc->find('withtag', ".atomicGroup.");
- \# to get all groups recursively contained in a group\\
- @groups = \$zinc->find('withtype', 'group', ".aGroup*");
- }
+ # to get all groups recursively contained in a group
+ @groups = $zinc->find('withtype', 'group', ".aGroup*");
+ \end{verbatim}
As detailled in \cmdref{addtag} command the following searchCommands are possible:
\begin{itemize}
@@ -4118,9 +4126,9 @@ some fields. Fields may overlap. They are drawn according to the index order:
field 0 is drawn before (thus under) field 1. The labelformat also optionnaly
describes a clipping rectangle. For example:
\begin{verbatim}
- $zinc->itemconfigure($track, -labelformat => 'a12a0+0+ x20x100>0 a2a0>1>0');
- ## ^ ^ ^
- ## field0 field1 field2
+ $zinc->itemconfigure($track, -labelformat => 'a12a0+0+0 x20x10^0>0 a2a0>1>0');
+ # ^ ^ ^
+ # field0 field1 field2
# the labelformat indicates that only the first 3 fields will be displayed:
# field 0 expands for the size of the text + 12 pixels.
# It starts at the top left point
@@ -4151,19 +4159,19 @@ field attributes you can modify :
As an example:
\begin{verbatim}
+ # this should display "Hello World" in white on black in field 0
$zinc->itemconfigure($track, 0, -text => 'Hello World',
-color => 'white',
-backcolor => 'black',
-filled => 1);
- # this should display "Hello World" in white on black in field 0
\end{verbatim}
It is possible to bind callbacks to fields, with the command \cmdref{bind} and
special tags (described \conceptref{Tags and bindings}{tagsAndBindings}).
As an example:
\begin{verbatim}
- $zinc->bind("$track:1", '<1>', \&acallback);
# this binds &acallback to field 1
+ $zinc->bind("$track:1", '<1>', \&acallback);
\end{verbatim}
Inside a callback function, it is possible to know which field the mouse cursor is over
@@ -4874,11 +4882,18 @@ the main window of this application. For more information, please refer to the
To use this module, you can import it either by adding, for example, the following
statements in your source code:
-\code{\\use Tk::Zinc::Debug;\\
-finditems(\$zinc);\\
-tree(\$zinc, -optionsToDisplay => '-tags', -optionsFormat => 'row');\\}
+\begin{verbatim}
+ use Tk::Zinc::Debug;
+
+ finditems($zinc);
+ tree($zinc, -optionsToDisplay => '-tags', -optionsFormat => 'row');
+\end{verbatim}
+
or simply by using the -M option of Perl:
-\code{\\perl -MTk::Zinc::Debug yourscript.pl\\}
+
+\begin{verbatim}
+ perl -MTk::Zinc::Debug yourscript.pl
+\end{verbatim}
\section{Tracing TkZinc methods call in Perl/Tk}
@@ -4904,8 +4919,15 @@ the standard output the following informations:
To use this module you can import it either by adding the following
statement in your source code:
-\code{\\use Tk::Zinc::TraceErrors;\\} or better, by using the -M option of Perl:
-\code{\\perl -MTk::Zinc::TraceErrors yourscript.pl\\}
+\begin{verbatim}
+ use Tk::Zinc::TraceErrors;
+\end{verbatim}
+
+or better, by using the -M option of Perl:
+
+\begin{verbatim}
+ perl -MTk::Zinc::TraceErrors yourscript.pl
+\end{verbatim}
\subsection{Tracking TkZinc segfaults in Perl/Tk}
@@ -4929,8 +4951,15 @@ It prints on the standard output the following informations:
To use this module you can import it either by adding the following
statement in your source code:
-\code{\\use Tk::Zinc::Trace;\\} or better, by using the -M option of Perl:
-\code{\\perl -MTk::Zinc::Trace yourscript.pl\\}
+\begin{verbatim}
+ use Tk::Zinc::Trace;
+\end{verbatim}
+
+or better, by using the -M option of Perl:
+
+\begin{verbatim}
+ perl -MTk::Zinc::Trace yourscript.pl
+\end{verbatim}
\section{zinc-demos}