Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / Tk::selection.3
.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "SELECTION 1"
.TH SELECTION 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation"
.SH "NAME"
Tk::Selection \- Manipulate the X selection
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
\&\fI$widget\fR\->\fBSelection\fR\fIOption\fR?(\fIargs\fR)?
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
This command provides an interface to the X selection mechanism and
implements the full selection functionality described in the
X Inter-Client Communication Conventions Manual (\s-1ICCCM\s0).
.PP
The widget object used to invoke the methods below determines which
display is used to access the selection.
In order to avoid conflicts with \fBselection\fR methods of widget classes
(e.g. \fBText\fR) this set of methods uses the prefix \fBSelection\fR.
The following methods are currently supported:
.IP "\fI$widget\fR\->\fBSelectionClear\fR?(\fB\-selection\fR=>\fIselection\fR)?" 4
.IX Item "$widget->SelectionClear?(-selection=>selection)?"
If \fIselection\fR exists anywhere on \fI$widget\fR's display, clear it
so that no window owns the selection anymore. \fISelection\fR
specifies the X selection that should be cleared, and should be an
atom name such as \s-1PRIMARY\s0 or \s-1CLIPBOARD\s0; see the Inter-Client
Communication Conventions Manual for complete details.
\&\fISelection\fR defaults to \s-1PRIMARY\s0.
Returns an empty string.
.IP "\fI$widget\fR\->\fBSelectionGet\fR?(?\fB\-selection\fR=>\fIselection\fR?,?\fB\-type\fR=>\fItype\fR?)?" 4
.IX Item "$widget->SelectionGet?(?-selection=>selection?,?-type=>type?)?"
Retrieves the value of \fIselection\fR from \fI$widget\fR's display and
returns it as a result. \fISelection\fR defaults to \s-1PRIMARY\s0.
.Sp
\&\fIType\fR specifies the form in which the selection is to be returned
(the desired ``target'' for conversion, in \s-1ICCCM\s0 terminology), and
should be an atom name such as \s-1STRING\s0 or \s-1FILE_NAME\s0; see the
Inter-Client Communication Conventions Manual for complete details.
\&\fIType\fR defaults to \s-1STRING\s0. The selection owner may choose to
return the selection in any of several different representation
formats, such as \s-1STRING\s0, \s-1ATOM\s0, \s-1INTEGER\s0, etc. (this format is different
than the selection type; see the \s-1ICCCM\s0 for all the confusing details).
.Sp
If \fIformat\fR is not \s-1STRING\s0 then things get messy, the following
description is from the Tcl/Tk man page as yet incompetely translated for
the perl version \- it is misleading at best.
.Sp
If the selection is returned in a non-string format, such as \s-1INTEGER\s0
or \s-1ATOM\s0, the \fBSelectionGet\fR converts it to a list of perl
values: atoms are converted to their
textual names, and anything else is converted integers.
.Sp
A goal of the perl port is to provide better handling of different
formats than Tcl/Tk does, which should be possible given perl's
wider range of ``types''. Although some thought went into this
in very early days of perl/Tk what exactly happens is still
\&\*(L"not quite right\*(R" and subject to change.
.IP "\fI$widget\fR\->\fBSelectionHandle\fR(?\fB\-selection\fR=>\fIselection\fR?,?\fB\-type\fR=>\fItype\fR?,?\fB\-format\fR=>\fIformat\fR? \fIcallback\fR)" 4
.IX Item "$widget->SelectionHandle(?-selection=>selection?,?-type=>type?,?-format=>format? callback)"
Creates a handler for selection requests, such that \fIcallback\fR will
be executed whenever \fIselection\fR is owned by \fI$widget\fR and
someone attempts to retrieve it in the form given by \fItype\fR
(e.g. \fItype\fR is specified in the \fBselection get\fR command).
\&\fISelection\fR defaults to \s-1PRIMARY\s0, \fItype\fR defaults to \s-1STRING\s0, and
\&\fIformat\fR defaults to \s-1STRING\s0. If \fIcallback\fR is an empty string
then any existing handler for \fI$widget\fR, \fItype\fR, and
\&\fIselection\fR is removed.
.RS 4
.Sp
.RS 8
When \fIselection\fR is requested, \fI$widget\fR is the selection owner,
and \fItype\fR is the requested type, \fIcallback\fR will be executed
with two additional arguments.
The two additional arguments
are \fIoffset\fR and \fImaxBytes\fR: \fIoffset\fR specifies a starting
character position in the selection and \fImaxBytes\fR gives the maximum
number of bytes to retrieve. The command should return a value consisting
of at most \fImaxBytes\fR of the selection, starting at position
\&\fIoffset\fR. For very large selections (larger than \fImaxBytes\fR)
the selection will be retrieved using several invocations of \fIcallback\fR
with increasing \fIoffset\fR values. If \fIcallback\fR returns a string
whose length is less than \fImaxBytes\fR, the return value is assumed to
include all of the remainder of the selection; if the length of
\&\fIcallback\fR's result is equal to \fImaxBytes\fR then
\&\fIcallback\fR will be invoked again, until it eventually
returns a result shorter than \fImaxBytes\fR. The value of \fImaxBytes\fR
will always be relatively large (thousands of bytes).
.Sp
If \fIcallback\fR returns an error (e.g. via \fBdie\fR)
then the selection retrieval is rejected
just as if the selection didn't exist at all.
.Sp
The \fIformat\fR argument specifies the representation that should be
used to transmit the selection to the requester (the second column of
Table 2 of the \s-1ICCCM\s0), and defaults to \s-1STRING\s0. If \fIformat\fR is
\&\s-1STRING\s0, the selection is transmitted as 8\-bit \s-1ASCII\s0 characters (i.e.
just in the form returned by \fIcommand\fR).
.Sp
If \fIformat\fR is not \s-1STRING\s0 then things get messy, the following
description is from the Tcl/Tk man page as yet untranslated for
the perl version \- it is misleading at best.
.Sp
If \fIformat\fR is
\&\s-1ATOM\s0, then the return value from \fIcommand\fR is divided into fields
separated by white space; each field is converted to its atom value,
and the 32\-bit atom value is transmitted instead of the atom name.
For any other \fIformat\fR, the return value from \fIcommand\fR is
divided into fields separated by white space and each field is
converted to a 32\-bit integer; an array of integers is transmitted
to the selection requester.
.Sp
The \fIformat\fR argument is needed only for compatibility with
many selection requesters, except Tcl/Tk. If Tcl/Tk is being
used to retrieve the selection then the value is converted back to
a string at the requesting end, so \fIformat\fR is
irrelevant.
.Sp
A goal of the perl port is to provide better handling of different
formats than Tcl/Tk does, which should be possible given perl's
wider range of ``types''. Although some thought went into this
in very early days of perl/Tk what exactly happens is still
\&\*(L"not quite right\*(R" and subject to change.
.RE
.IP "\fI$widget\fR\->\fBSelectionOwner\fR?(\fB\-selection\fR=>\fIselection\fR)?" 8
.IX Item "$widget->SelectionOwner?(-selection=>selection)?"
\&\fBSelectionOwner\fR returns the
window in this application that owns \fIselection\fR on the display
containing \fI$widget\fR, or an empty string if no window in this
application owns the selection. \fISelection\fR defaults to \s-1PRIMARY\s0.
.IP "\fI$widget\fR\->\fBSelectionOwn\fR?(?\fB\-command\fR=>\fIcallback\fR?,?\fB\-selection\fR=>\fIselection\fR?)?" 8
.IX Item "$widget->SelectionOwn?(?-command=>callback?,?-selection=>selection?)?"
\&\fBSelectionOwn\fR causes \fI$widget\fR to become
the new owner of \fIselection\fR on \fI$widget\fR's display, returning
an empty string as result. The existing owner, if any, is notified
that it has lost the selection.
If \fIcallback\fR is specified, it will be executed when
some other window claims ownership of the selection away from
\&\fI$widget\fR. \fISelection\fR defaults to \s-1PRIMARY\s0.
.RE
.RS 4
.RE
.SH "KEYWORDS"
.IX Header "KEYWORDS"
clear, format, handler, \s-1ICCCM\s0, own, selection, target, type