archie/tk3.6/doc/ManageGeom.3
2024-05-27 16:13:40 +02:00

94 lines
3.8 KiB
Groff

'\"
'\" Copyright (c) 1990 The Regents of the University of California.
'\" All rights reserved.
'\"
'\" Permission is hereby granted, without written agreement and without
'\" license or royalty fees, to use, copy, modify, and distribute this
'\" documentation for any purpose, provided that the above copyright
'\" notice and the following two paragraphs appear in all copies.
'\"
'\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
'\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
'\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
'\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
'\"
'\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
'\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
'\" AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
'\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
'\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
'\"
'\" $Header: /user6/ouster/wish/man/RCS/ManageGeom.3,v 1.5 93/04/01 09:41:43 ouster Exp $ SPRITE (Berkeley)
'\"
.so man.macros
.HS Tk_ManageGeometry tkc
.BS
.SH NAME
Tk_ManageGeometry \- arrange to handle geometry requests for a window
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
.sp
\fBTk_ManageGeometry\fR(\fItkwin, proc, clientData\fR)
.SH ARGUMENTS
.AS Tk_GeometryProc clientData
.AP Tk_Window tkwin in
Token for window to be managed.
.AP Tk_GeometryProc *proc in
Procedure to invoke to handle geometry requests on \fItkwin\fR, or
NULL to indicate that \fItkwin\fR's geometry shouldn't be managed
anymore.
.AP ClientData clientData in
Arbitrary one-word value to pass to \fIproc\fR.
.BE
.SH DESCRIPTION
.PP
\fBTk_ManageGeometry\fR arranges for \fIproc\fR to be invoked
whenever \fBTk_GeometryRequest\fR is called to change the desired
geometry for \fItkwin\fR. \fBTk_ManageGeometry\fR is typically
invoked by geometry managers when they take control of a window's
geometry.
.PP
\fIProc\fP should have arguments and results that match the
type \fBTk_GeometryProc\fR:
.nf
.RS
typedef void Tk_GeometryProc(
.RS
ClientData \fIclientData\fR,
Tk_Window \fItkwin\fR);
.RE
.RE
.fi
The parameters to \fIproc\fR will be identical to the
corresponding parameters passed to \fBTk_ManageGeometry\fR.
Typically, \fIclientData\fR points to a data
structure containing application-specific information about
how to manage \fItkwin\fR's geometry.
.PP
\fIProc\fR will be called during each call to \fBTk_GeometryRequest\fR
for \fItkwin\fR. \fIProc\fR can use macros like \fBTk_ReqWidth\fR
to retrieve the arguments passed to \fBTk_GeometryRequest\fR. It
should do what it can to meet the request, subject to the space
available in \fItkwin\fR's parent and its own policies for managing geometry.
If \fIproc\fR can meet the request, it should call procedures like
\fBTk_ResizeWindow\fR or \fBTk_MoveWindow\fR to carry out the actual
geometry change. In some cases it may make sense for \fIproc\fR not
to process the geometry request immediately, but rather to schedule a
procedure to do it later, using \fBTk_DoWhenIdle\fR. This approach
is likely to be more efficient in situations where several geometry
requests occur simultaneously: only a single geometry change will
be made, after all the requests have been registered.
.PP
If \fIproc\fR is specified as NULL, then the geometry handler for
\fItkwin\fR will be eliminated, leaving \fItkwin\fR unmanaged.
Calls to \fBTk_GeometryRequest\fR have no effect for unmanaged
windows except to store the requested size in a structure where
they can be retrieved by macros like \fBTk_ReqWidth\fR. If
\fBTk_GeometryRequest\fR has never been invoked for a window then
it is unmanaged.
.SH KEYWORDS
callback, geometry, managed, request, unmanaged