SetClassProcs.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
- '"
- '" Copyright (c) 2000 Ajuba Solutions.
- '"
- '" See the file "license.terms" for information on usage and redistribution
- '" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- '"
- '" RCS: @(#) $Id: SetClassProcs.3,v 1.1 2000/11/22 01:50:26 ericm Exp $
- '"
- .so man.macros
- .TH Tk_SetClassProcs 3 8.4 Tk "Tk Library Procedures"
- .BS
- .SH NAME
- Tk_SetClassProcs - register widget specific procedures
- .SH SYNOPSIS
- .nf
- fB#include <tk.h>fR
- .sp
- fBTk_SetClassProcsfR(fItkwin, procs, instanceDatafR)
- .SH ARGUMENTS
- .AS Tk_ClassProc instanceData
- .AP Tk_Window tkwin in
- Token for window to modify.
- .AP Tk_ClassProcs *procs in
- Pointer to data structure containing widget specific procedures.
- The data structure pointed to by fIprocsfR must be static:
- Tk keeps a reference to it as long as the window exists.
- .AP ClientData instanceData in
- Arbitrary one-word value to pass to widget callbacks.
- .BE
- .SH DESCRIPTION
- .PP
- fBTk_SetClassProcsfR is called to register a set of procedures that
- are used as callbacks in different places.
- .PP
- The structure pointed to by fIprocsfR contains the following:
- .CS
- typedef struct Tk_ClassProcs {
- unsigned int fIsizefR;
- Tk_ClassWorldChangedProc *fIworldChangedProcfR;
- Tk_ClassCreateProc *fIcreateProcfR;
- Tk_ClassModalProc *fImodalProcfR;
- } Tk_ClassProcs;
- .CE
- The fIsizefR field is used to simplify future expansion of the
- structure. It should always be set to (literally) fBsizeof(Tk_ClassProcs)fR.
- .PP
- fIworldChangedProcfR is invoked when the system has altered
- in some way that requires some reaction from the widget. For example,
- when a font alias (see the fBfontfR manual entry) is reconfigured,
- widgets configured to use that font alias must update their display
- accordingly. fIworldChangedProcfR should have arguments and results
- that match the type fBTk_ClassWorldChangedProcfR:
- .CS
- typedef void Tk_ClassWorldChangedProc(
- ClientData fIinstanceDatafR);
- .CE
- The fIinstanceDatafR parameter passed to the fIworldChangedProcfR
- will be identical to the fIinstanceDatafR paramter passed to
- fBTk_SetClassProcsfR.
- .PP
- fIcreateProcfR is used to create platform-dependant windows. It is
- invoked by fBTk_MakeWindowExistfR. fIcreateProcfR should have
- arguments and results that match the type fBTk_ClassCreateProcfR:
- .CS
- typedef Window Tk_ClassCreateProc(
- Tk_Window fItkwinfR,
- Window fIparentfR,
- ClientData fIinstanceDatafR);
- .CE
- The fItkwinfR and fIinstanceDatafR parameters will be identical to
- the fItkwinfR and fIinstanceDatafR parameters passed to
- fBTk_SetClassProcsfR. The fIparentfR parameter will be the parent
- of the window to be created. The fIcreateProcfR should return the
- created window.
- .PP
- fImodalProcfR is invoked after all bindings on a widget have been
- triggered in order to handle a modal loop. fImodalProcfR should
- have arguments and results that match the type fBTk_ClassModalProcfR:
- .CS
- typedef void Tk_ClassModalProc(
- Tk_Window fItkwinfR,
- XEvent *fIeventPtrfR);
- .CE
- The fItkwinfR parameter to fImodalProcfR will be identical to the
- fItkwinfR parameter passed to fBTk_SetClassProcsfR. The
- fIeventPtrfR parameter will be a pointer to an XEvent structure
- describing the event being processed.
- .SH KEYWORDS
- callback, class