Tk_ManageGeometry - arrange to handle geometry requests for a window

SYNOPSIS

#include <tk.h>

Tk_ManageGeometry(tkwin, proc, clientData)

ARGUMENTS

Tk_Window tkwin (in)
Token for window to be managed.
Tk_GeometryProc *proc (in)
Procedure to invoke to handle geometry requests on tkwin, or NULL to indicate that tkwin's geometry shouldn't be managed anymore.
ClientData clientData (in)
Arbitrary one-word value to pass to proc.

DESCRIPTION

Tk_ManageGeometry arranges for proc to be invoked whenever Tk_GeometryRequest is called to change the desired geometry for tkwin. Tk_ManageGeometry is typically invoked by geometry managers when they take control of a window's geometry.

Proc should have arguments and results that match the type Tk_GeometryProc:


The parameters to proc will be identical to the corresponding parameters passed to Tk_ManageGeometry. Typically, clientData points to a data structure containing application-specific information about how to manage tkwin's geometry.

Proc will be called during each call to Tk_GeometryRequest for tkwin. Proc can use macros like Tk_ReqWidth to retrieve the arguments passed to Tk_GeometryRequest. It should do what it can to meet the request, subject to the space available in tkwin's parent and its own policies for managing geometry. If proc can meet the request, it should call procedures like Tk_ResizeWindow or Tk_MoveWindow to carry out the actual geometry change. In some cases it may make sense for proc not to process the geometry request immediately, but rather to schedule a procedure to do it later, using Tk_DoWhenIdle. 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.

If proc is specified as NULL, then the geometry handler for tkwin will be eliminated, leaving tkwin unmanaged. Calls to Tk_GeometryRequest have no effect for unmanaged windows except to store the requested size in a structure where they can be retrieved by macros like Tk_ReqWidth. If Tk_GeometryRequest has never been invoked for a window then it is unmanaged.

KEYWORDS

callback, geometry, managed, request, unmanaged