Manual Pages for UNIX Darwin command on man Tk_SetClassProcs
MyWebUniversity

Manual Pages for UNIX Darwin command on man Tk_SetClassProcs

TkSetClassProcs(3) Tk Library Procedures TkSetClassProcs(3)

NAME

TkSetClassProcs - register widget specific procedures

SYNOPSIS

##iinncclluuddee <>

TTkkSSeettCCllaassssPPrrooccss(tkwin, procs, instanceData) AARRGGUUMMEENNTTSS TkWindow tkwin (in) Token for window to modify.

TkClassProcs *procs (in) Pointer to data structure con-

taining widget specific proce-

dures. The data structure pointed to by procs must be static: Tk keeps a reference to it as long as the window exists.

ClientData instanceData (in) Arbitrary one-word value to

pass to widget callbacks.

DESCRIPTION

TTkkSSeettCCllaassssPPrrooccss is called to register a set of procedures that are used as callbacks in different places. The structure pointed to by procs contains the following: typedef struct TkClassProcs { unsigned int size; TkClassWorldChangedProc *worldChangedProc; TkClassCreateProc *createProc; TkClassModalProc *modalProc; } TkClassProcs; The size field is used to simplify future expansion of the structure. It should always be set to (literally) ssiizzeeooff((TTkkCCllaassssPPrrooccss)). worldChangedProc 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 ffoonntt manual entry) is reconfigured, widgets configured

to use that font alias must update their display accordingly. world-

ChangedProc should have arguments and results that match the type TTkkCCllaassssWWoorrllddCChhaannggeeddPPrroocc: typedef void TkClassWorldChangedProc( ClientData instanceData);

The instanceData parameter passed to the worldChangedProc will be iden-

tical to the instanceData paramter passed to TTkkSSeettCCllaassssPPrrooccss.

createProc is used to create platform-dependant windows. It is invoked

by TTkkMMaakkeeWWiinnddoowwEExxiisstt. createProc should have arguments and results that match the type TTkkCCllaassssCCrreeaatteePPrroocc: typedef Window TkClassCreateProc( TkWindow tkwin, Window parent, ClientData instanceData); The tkwin and instanceData parameters will be identical to the tkwin and instanceData parameters passed to TTkkSSeettCCllaassssPPrrooccss. The parent

parameter will be the parent of the window to be created. The cre-

ateProc should return the created window. modalProc is invoked after all bindings on a widget have been triggered in order to handle a modal loop. modalProc should have arguments and results that match the type TTkkCCllaassssMMooddaallPPrroocc: typedef void TkClassModalProc( TkWindow tkwin, XEvent *eventPtr);

The tkwin parameter to modalProc will be identical to the tkwin parame-

ter passed to TTkkSSeettCCllaassssPPrrooccss. The eventPtr parameter will be a pointer to an XEvent structure describing the event being processed. KKEEYYWWOORRDDSS callback, class Tk 8.4 TkSetClassProcs(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™