| 1 |
# Copyright (c) 1990-1994 The Regents of the University of California. |
| 2 |
# Copyright (c) 1994-1996 Sun Microsystems, Inc. |
| 3 |
# See the file "license.terms" for information on usage and redistribution |
| 4 |
# of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 5 |
# |
| 6 |
# |
| 7 |
|
| 8 |
=head1 NAME |
| 9 |
|
| 10 |
Tk_ManageGeometry - arrange to handle geometry requests for a window |
| 11 |
|
| 12 |
=for category C Programming |
| 13 |
|
| 14 |
=head1 SYNOPSIS |
| 15 |
|
| 16 |
B<#include E<lt>tk.hE<gt>> |
| 17 |
|
| 18 |
B<Tk_ManageGeometry>(I<tkwin, mgrPtr, clientData>) |
| 19 |
|
| 20 |
=head1 ARGUMENTS |
| 21 |
|
| 22 |
=over 4 |
| 23 |
|
| 24 |
=item Tk_Window tkwin (in) |
| 25 |
|
| 26 |
Token for window to be managed. |
| 27 |
|
| 28 |
=item Tk_GeomMgr *mgrPtr (in) |
| 29 |
|
| 30 |
Pointer to data structure containing information about the |
| 31 |
geometry manager, or NULL to indicate that I<tkwin>'s geometry |
| 32 |
shouldn't be managed anymore. |
| 33 |
The data structure pointed to by I<mgrPtr> must be static: |
| 34 |
Tk keeps a reference to it as long as the window is managed. |
| 35 |
|
| 36 |
=item ClientData clientData (in) |
| 37 |
|
| 38 |
Arbitrary one-word value to pass to geometry manager callbacks. |
| 39 |
|
| 40 |
=back |
| 41 |
|
| 42 |
=head1 DESCRIPTION |
| 43 |
|
| 44 |
B<Tk_ManageGeometry> arranges for a particular geometry manager, |
| 45 |
described by the I<mgrPtr> argument, to control the geometry |
| 46 |
of a particular slave window, given by I<tkwin>. |
| 47 |
If I<tkwin> was previously managed by some other geometry manager, |
| 48 |
the previous manager loses control in favor of the new one. |
| 49 |
If I<mgrPtr> is NULL, geometry management is cancelled for |
| 50 |
I<tkwin>. |
| 51 |
|
| 52 |
The structure pointed to by I<mgrPtr> contains information about |
| 53 |
the geometry manager: |
| 54 |
|
| 55 |
typedef struct { |
| 56 |
char *name; |
| 57 |
Tk_GeomRequestProc *requestProc; |
| 58 |
Tk_GeomLostSlaveProc *lostSlaveProc; |
| 59 |
} Tk_GeomMgr; |
| 60 |
|
| 61 |
The I<name> field is the textual name for the geometry manager, |
| 62 |
such as B<pack> or B<place>; this value will be returned |
| 63 |
by the command B<winfo manager>. |
| 64 |
|
| 65 |
I<requestProc> is a procedure in the geometry manager that |
| 66 |
will be invoked whenever B<Tk_GeometryRequest> is called by the |
| 67 |
slave to change its desired geometry. |
| 68 |
I<requestProc> should have arguments and results that match the |
| 69 |
type B<Tk_GeomRequestProc>: |
| 70 |
|
| 71 |
typedef void Tk_GeomRequestProc( |
| 72 |
ClientData clientData, |
| 73 |
Tk_Window tkwin); |
| 74 |
|
| 75 |
The parameters to I<requestProc> will be identical to the |
| 76 |
corresponding parameters passed to B<Tk_ManageGeometry>. |
| 77 |
I<clientData> usually points to a data |
| 78 |
structure containing application-specific information about |
| 79 |
how to manage I<tkwin>'s geometry. |
| 80 |
|
| 81 |
The I<lostSlaveProc> field of I<mgrPtr> points to another |
| 82 |
procedure in the geometry manager. |
| 83 |
Tk will invoke I<lostSlaveProc> if some other manager |
| 84 |
calls B<Tk_ManageGeometry> to claim |
| 85 |
I<tkwin> away from the current geometry manager. |
| 86 |
I<lostSlaveProc> is not invoked if B<Tk_ManageGeometry> is |
| 87 |
called with a NULL value for I<mgrPtr> (presumably the current |
| 88 |
geometry manager has made this call, so it already knows that the |
| 89 |
window is no longer managed), nor is it called if I<mgrPtr> |
| 90 |
is the same as the window's current geometry manager. |
| 91 |
I<lostSlaveProc> should have |
| 92 |
arguments and results that match the following prototype: |
| 93 |
|
| 94 |
typedef void Tk_GeomLostSlaveProc( |
| 95 |
ClientData clientData, |
| 96 |
Tk_Window tkwin); |
| 97 |
|
| 98 |
The parameters to I<lostSlaveProc> will be identical to the |
| 99 |
corresponding parameters passed to B<Tk_ManageGeometry>. |
| 100 |
|
| 101 |
=head1 KEYWORDS |
| 102 |
|
| 103 |
callback, geometry, managed, request, unmanaged |