Manual Pages for UNIX Darwin command on man Tk_SetOptions
MyWebUniversity

Manual Pages for UNIX Darwin command on man Tk_SetOptions

TkSetOptions(3) Tk Library Procedures TkSetOptions(3)

NAME

TkCreateOptionTable, TkDeleteOptionTable, TkInitOptions, TkSetOp-

tions, TkFreeSavedOptions, TkRestoreSavedOptions, TkGetOptionValue,

TkGetOptionInfo, TkFreeConfigOptions, TkOffset - process configura-

tion options

SYNOPSIS

##iinncclluuddee <>

TkOptionTable TkCreateOptionTable(nep tmltPr) TkDeleteOptionTable(pinal) int TkInitOptions(nep rcrPr otoTbe twn) int TkSetOptions(nep rcrPr otoTbe oj, bv twn svPr msPr) TkFreeSavedOptions(aePr) TkRestoreSavedOptions(aePr) TclObj * TkGetOptionValue(nep rcrPr otoTbe nmPr twn) TclObj * TkGetOptionInfo(nep rcrPr otoTbe nmPr twn) TkFreeConfigOptions(eodt, pinal, ki) int TTkkOOffffsseett((type, field)) AARRGGUUMMEENNTTSS TclInterp *interp (in) A Tcl interpreter. Most procedures use this only

for returning error mes-

sages; if it is NULL then no error messages are

returned. For TTkkCCrreeaatteeOOpp-

ttiioonnTTaabbllee the value cannot be NULL; it gives the interpreter in which the option table will be used. TkOptionSpec *templatePtr (in) Points to an array of static information that describes the configuration options that are supported. Used to build a

TkOptionTable. The infor-

mation pointed to by this argument must exist for the lifetime of the TkOptionTable. TkOptionTable optionTable (in) Token for an option table. Must have been returned by

a previous call to TTkkCCrree-

ateOptionTable char *recordPtr (in/out) Points to structure in

which values of configura-

tion options are stored; fields of this record are modified by procedures such s TkSetOptions n ra by procedures such as TkGetOptionValue TkWindow tkwin (in) For options such as

TKOPTIONCOLOR, this argu-

ment indicates the window in which the option will be used. If optionTable uses

no window-dependent

options, then a NULL value may be supplied for this argument. int objc (in) Number of values in objv.

TclObj *CONST objv[] (in) Command-line arguments for

setting configuring options. TkSavedOptions *savePtr (out) If not NULL, the structure pointed to by this argument is filled in with the old values of any options that

were modified and old val-

ues are restored automati-

cally if an error occurs in TkSetOptions int *maskPtr (out) If not NULL, the word pointed to by maskPtr is

filled in with the bit-wise

OR of the typeMask fields for the options that were modified.

TkSavedOptions *savedPtr (in/out) Points to a structure pre-

viously filled in by TkSetOptions ih l vl ues of modified options. TclObj *namePtr (in) The value of this object is the name of a particular option. If NULL is passed o TkGetOptionInfo hn information is returned for all options. Must not be UL hn TkGetOptionValue is called. type name type (in) The name of the type of a record. field name field (in) The name of a field in records of type type.

DESCRIPTION

These procedures handle most of the details of parsing configuration options such as those for Tk widgets. Given a description of what

options are supported, these procedures handle all the details of pars-

ing options and storing their values into a C structure associated with

the widget or object. The procedures were designed primarily for wid-

gets in Tk, but they can also be used for other kinds of objects that have configuration options. In the rest of this manual page ``widget'' will be used to refer to the object whose options are being managed; in practice the object may not actually be a widget. The term ``widget

record'' is used to refer to the C-level structure in which information

about a particular widget or object is stored. Note: the easiest way to learn how to use these procedures is to look at a working example. In Tk, the simplest example is the code that implements the button family of widgets, which is an ttkkBBuuttttoonn..cc. Other examples are in ttkkSSqquuaarree..cc and ttkkMMeennuu..cc. In order to use these procedures, the code that implements the widget

must contain a static array of TkOptionSpec structures. This is a tem-

plate that describes the various options supported by that class of

widget; there is a separate template for each kind of widget. The tem-

plate contains information such as the name of each option, its type, its default value, and where the value of the option is stored in the widget record. See TEMPLATES below for more detail.

In order to process configuration options efficiently, the static tem-

plate must be augmented with additional information that is available ny t utm. h poeue TkCreateOptionTable rae ti dynamic information from the template and returns a TkOptionTable token that describes both the static and dynamic information. All of h ohr rcdrs sc a TkSetOptions, ae TOtoTbe oe a agmn. yial, TkCreateOptionTable s ald h frt time that a widget of a particular class is created and the resulting TkOptionTable is used in the future for all widgets of that class. A TkOptionTable may be used only in a single interpreter, given by the nep ruet o TkCreateOptionTable We a oto tbe s o ogr edd TkDeleteOptionTable hud e ald o re l o is resources. All of the option tables for a Tcl interpreter are freed automatically if the interpreter is deleted. TkInitOptions s noe we a e wde i cetd o e te

default values for all of the widget's configuration options. TTkkIInnii-

tOptions s asd tkn o a oto tbe otoTbe ad pointer to a widget record (recordPtr), which is the C structure that od ifrain bu ti wde. TkInitOptions ss h ifra tion in the option table to choose an appropriate default for each option, then it stores the default value directly into the widget record, overwriting any information that was already present in the igt eod TkInitOptions nral rtrs CO. f n ro occurred while setting the default values (e.g., because a default

value was erroneous) then TCLERROR is returned and an error message is

left in interp's result if interp isn't NULL. TkSetOptions s noe t mdf cniuain pin bsd n information specified in a Tcl command. The command might be one that creates a new widget, or a command that modifies options on an existing

widget. The objc and objv arguments describe the values of the argu-

ments from the Tcl command. Objv must contain an even number of objects: the first object of each pair gives the name of an option and h scn ojc gvs h nw au fr ht pin TkSetOptions looks up each name in optionTable, checks that the new value of the option conforms to the type in optionTable, and stores the value of the

pin no h wde rcr gvn y eodt. TkSetOptions o-

mally returns TCLOK. If an error occurred (such as an unknown option

name or an illegal option value) then TCLERROR is returned and an

error message is left in interp's result if interp isn't NULL.

TkSetOptions a to diinl etrs Frt i te akt ag-

ment isn't NULL then it points to an integer value that is filled in with information about the options that were modified. For each option n h tmlt pse t TkCreateOptionTable tee s tpMs field. The bits of this field are defined by the code that implements

the widget; for example, each bit might correspond to a particular con-

figuration option. Alternatively, bits might be used functionally. For example, one bit might be used for redisplay: all options that affect the widget's display, such that changing the option requires the widget to be redisplayed, might have that bit set. Another bit might indicate that the geometry of the widget must be recomputed, and so on. TkSetOptions Rs oehr h tpMs fed fo al h otos that were modified and returns this value at *maskPtr; the caller can then use this information to optimize itself so that, for example, it doesn't redisplay the widget if the modified options don't affect the widget's appearance. h scn adtoa faue f TkSetOptions a t d wt err recovery. If an error occurs while processing configuration options, this feature makes it possible to restore all the configuration options to their previous values. Errors can occur either while processing pin i TkSetOptions o ltr n h cle. n ay ae te alr os diinl rcsig fe TkSetOptions rtrs fr example, it might use an option value to set a trace on a variable and may detect an error if the variable is an array instead of a scalar.

Error recovery is enabled by passing in a non-NULL value for the

aet agmn t TkSetOptions; hs hud e pitr o n uninitialized TkSavedOptions structure on the caller's stack. TkSetOptions vrrts h srcue one t b svPr ih

information about the old values of any options modified by the proce-

ue I TkSetOptions rtrs ucsfly te alr ss h structure in one of two ways. If the caller completes its processing of the new options without any errors, then it must pass the structure o TkFreeSavedOptions o ht h od aus a b fed I te caller detects an error in its processing of the new options, then it hud as h srcue o TkRestoreSavedOptions wih il oy the old values back into the widget record and free the new values. If TkSetOptions eet a err hn t uoaial rsoe ay options that had already been modified and leaves *savePtr in an empty tt: h cle ne nt al ihr TkFreeSavedOptions r TkRestoreSavedOptions I te aet agmn t TkSetOptions i UL hn TkSetOptions re ec od pin au imdaey hn t sets a new value for the option. In this case, if an error occurs in the third option, the old values for the first two options cannot be restored. TkGetOptionValue eun te urn vle f cniuain pin for a particular widget. The namePtr argument contains the name of an pin TkGetOptionValue ue otoTbe o okp h oto ad extract its value from the widget record pointed to by recordPtr, then it returns an object containing that value. If an error occurs (e.g., because namePtr contains an unknown option name) then NULL is returned and an error message is left in interp's result unless interp is NULL. TkGetOptionInfo eun ifrain bu cniuain pin i a form suitable for ccoonnffiigguurree widget commands. If the namePtr argument

is not NULL, it points to an object that gives the name of a configura-

in pin TkGetOptionInfo rtrs n bet otiig ls wt five elements, which are the name of the option, the name and class used for the option in the option database, the default value for the option, and the current value for the option. If the namePtr argument s UL te TkGetOptionInfo rtrs nomto aot l otos n

the form of a list of lists; each sublist describes one option. Syn-

onym options are handled differently depending on whether namePtr is NULL: if namePtr is NULL then the sublist for each synonym option has only two elements, which are the name of the option and the name of the

other option that it refers to; if namePtr is non-NULL and names a syn-

onym option then the object returned is the five-element list for the

other option that the synonym refers to. If an error occurs (e.g., because namePtr contains an unknown option name) then NULL is returned and an error message is left in interp's result unless interp is NULL. TkFreeConfigOptions ut e noe we a igt s eee. t frees all of the resources associated with any of the configuration options defined in recordPtr by optionTable.

The TTkkOOffffsseett macro is provided as a safe way of generating the objOff-

set and internalOffset values for entries in TkOptionSpec structures. It takes two arguments: the name of a type of record, and the name of a field in that record. It returns the byte offset of the named field in records of the given type. TTEEMMPPLLAATTEESS h ary f kpinpc tutrs asd o TkCreateOptionTable

via its templatePtr argument describes the configuration options sup-

ported by a particular class of widgets. Each structure specifies one configuration option and has the following fields: typedef struct { TkOptionType type; char *optionName; char *dbName; char *dbClass; char *defValue; int objOffset; int internalOffset; int flags; ClientData clientData; int typeMask; } TkOptionSpec; The type field indicates what kind of configuration option this is

(e.g. TKOPTIONCOLOR for a color value, or TKOPTIONINT for an inte-

ger value). Type determines how the value of the option is parsed

(more on this below). The optionName field is a string such as -ffoonntt

or -bbgg; it is the name used for the option in Tcl commands and passed

to procedures via the objc or namePtr arguments. The dbName and bls fed ae sd y TkInitOptions o ok p dfut au for this option in the option database; if dbName is NULL then the pin aaae s o ue b TkInitOptions fr hs pin Te defValue field specifies a default value for this configuration option if no value is specified in the option database. The objOffset and internalOffset fields indicate where to store the value of this option in widget records (more on this below); values for the objOffset and internalOffset fields should always be generated with the TTkkOOffffsseett macro. The flags field contains additional information to control the processing of this configuration option (see below for details).

ClientData provides additional type-specific data needed by certain

types. For instance, for TKOPTIONCOLOR types, clientData is a string

giving the default value to use on monochrome displays. See the descriptions of the different types below for details. The last field, yeak i ue b TkSetOptions t rtr ifrain bu wih pin wr mdfe; e te ecito o TkSetOptions aoe o details. hn TkInitOptions n TkSetOptions soe h vle f n pin no the widget record, they can do it in either of two ways. If the objOffset field of the TkOptionSpec is greater than or equal to zero, then the value of the option is stored as a (TclObj *) at the location in the widget record given by objOffset. If the internalOffset field of the TkOptionSpec is greater than or equal to zero, then the value

of the option is stored in a type-specific internal form at the loca-

tion in the widget record given by internalOffset. For example, if the

option's type is TKOPTIONINT then the internal form is an integer.

If the objOffset or internalOffset field is negative then the value is not stored in that form. At least one of the offsets must be greater than or equal to zero. The flags field consists of one or more bits ORed together. At present

only a single flag is supported: TKOPTIONNULLOK. If this bit is set

for an option then an empty string will be accepted as the value for the option and the resulting internal form will be a NULL pointer, a zero value, or NNoonnee, depending on the type of the option. If the flag

is not set then empty strings will result in errors. TKOPTIONNULLOK

is typically used to allow a feature to be turned off entirely, e.g.

set a cursor value to NNoonnee so that a window simply inherits its par-

ent's cursor. Not all option types support the TKOPTIONNULLOK flag;

for those that do, there is an explicit indication of that fact in the descriptions below. The type field of each TkOptionSpec structure determines how to parse the value of that configuration option. The legal value for type, and the corresponding actions, are described below. If the type requires a ki vle o e asd no rcdrs ie TkSetOptions o i i uses the clientData field of the TkOptionSpec, then it is indicated explicitly; if not mentioned, the type requires neither tkwin nor clientData. TTKKOOPPTTIIOONNAANNCCHHOORR

The value must be a standard anchor position such as nnee or cceenn-

tteerr. The internal form is a TkAnchor value like the ones returned by TTkkGGeettAAnncchhoorrFFrroommOObbjj. TTKKOOPPTTIIOONNBBIITTMMAAPP The value must be a standard Tk bitmap name. The internal form

is a Pixmap token like the ones returned by TTkkAAllllooccBBiittmmaappFFrroo-

mmOObbjj. This option type requires tkwin to be supplied to proce-

ue sc a TkSetOptions, n i spot te

TKOPTIONNULLOK flag.

TTKKOOPPTTIIOONNBBOOOOLLEEAANN The value must be a standard boolean value such as ttrruuee or nnoo. The internal form is an integer with value 0 or 1. TTKKOOPPTTIIOONNBBOORRDDEERR

The value must be a standard color name such as rreedd or ##ffff88008800.

The internal form is a Tk3DBorder token like the ones returned by TTkkAAlllloocc33DDBBoorrddeerrFFrroommOObbjj. This option type requires tkwin to e upid o rcdrs uh s TkSetOptions ad t uprs

the TKOPTIONNULLOK flag.

TTKKOOPPTTIIOONNCCOOLLOORR

The value must be a standard color name such as rreedd or ##ffff88008800.

The internal form is an (XColor *) token like the ones returned by TTkkAAllllooccCCoolloorrFFrroommOObbjj. This option type requires tkwin to be upid o rcdrs uh s TkSetOptions ad t uprs

the TKOPTIONNULLOK flag.

TTKKOOPPTTIIOONNCCUURRSSOORR The value must be a standard cursor name such as ccrroossss or @@ffoooo. The internal form is a TkCursor token like the ones returned by TTkkAAllllooccCCuurrssoorrFFrroommOObbjj. This option type requires tkwin to be upid o rcdrs uh s TkSetOptions ad hn h option is set the cursor for the window is changed by calling XXDDeeffiinneeCCuurrssoorr. This option type also supports the

TKOPTIONNULLOK flag.

TTKKOOPPTTIIOONNCCUUSSTTOOMM This option allows applications to define new option types. The clientData field of the entry points to a structure defining the

new option type. See the section CUSTOM OPTION TYPES below for

details. TTKKOOPPTTIIOONNDDOOUUBBLLEE

The string value must be a floating-point number in the format

accepted by ssttrrttooll. The internal form is a C ddoouubbllee value.

This option type supports the TKOPTIONNULLOK flag; if a NULL

value is set, the internal representation is set to zero. TTKKOOPPTTIIOONNEENNDD Marks the end of the template. There must be a TkOptionSpec

structure with type TKOPTIONEND at the end of each template.

If the clientData field of this structure isn't NULL, then it points to an additional array of TkOptionSpec's, which is

itself terminated by another TKOPTIONEND entry. Templates may

be chained arbitrarily deeply. This feature allows common options to be shared by several widget classes. TTKKOOPPTTIIOONNFFOONNTT The value must be a standard font name such as TTiimmeess 1166. The internal form is a TkFont handle like the ones returned by

TTkkAAllllooccFFoonnttFFrroommOObbjj. This option type requires tkwin to be sup-

le t poeue sc a TkSetOptions, n i spot te

TKOPTIONNULLOK flag.

TTKKOOPPTTIIOONNIINNTT The string value must be an integer in the format accepted by ssttrrttooll (e.g. 00 and 00xx prefixes may be used to specify octal or hexadecimal numbers, respectively). The internal form is a C iinntt value. TTKKOOPPTTIIOONNJJUUSSTTIIFFYY The value must be a standard justification value such as lleefftt. The internal form is a TkJustify like the values returned by TTkkGGeettJJuussttiiffyyFFrroommOObbjj. TTKKOOPPTTIIOONNPPIIXXEELLSS The value must specify a screen distance such as 22ii or 66..44. The internal form is an integer value giving a distance in pixels, like the values returned by TTkkGGeettPPiixxeellssFFrroommOObbjj. Note: if the objOffset field isn't used then information about the original

value of this option will be lost. See OOBBJJOOFFFFSSEETT VVSS.. IINNTTEERR-

NNAALLOOFFFFSSEETT below for details. This option type supports the

TKOPTIONNULLOK flag; if a NULL value is set, the internal

representation is set to zero. TTKKOOPPTTIIOONNRREELLIIEEFF The value must be standard relief such as rraaiisseedd. The internal form is an integer relief value such as TKRELIEFRAISED. This

option type supports the TKOPTIONNULLOK flag; if the empty

string is specified as the value for the option, the integer relief value is set to TKRELIEFNULL. TTKKOOPPTTIIOONNSSTTRRIINNGG The value may be any string. The internal form is a (char *) pointer that points to a dynamically allocated copy of the

value. This option type supports the TKOPTIONNULLOK flag.

TTKKOOPPTTIIOONNSSTTRRIINNGGTTAABBLLEE For this type, clientData is a pointer to an array of strings suitable for passing to TTccllGGeettIInnddeexxFFrroommOObbjj. The value must be one of the strings in the table, or a unique abbreviation of one of the strings. The internal form is an integer giving the index into the table of the matching string, like the return value from TTccllGGeettSSttrriinnggFFrroommOObbjj. TTKKOOPPTTIIOONNSSYYNNOONNYYMM This type is used to provide alternative names for an option

(for example, -bbgg is often used as a synonym for -bbaacckkggrroouunndd).

The cclliieennttDDaattaa field is a (char *) pointer that gives the name of another option in the same table. Whenever the synonym option is used, the information from the other option will be used instead. TTKKOOPPTTIIOONNWWIINNDDOOWW The value must be a window path name. The internal form is a TTkkWWiinnddooww token for the window. This option type requires tkwin o e upid o rcdrs uh s TkSetOptions i odr o

identify the application), and it supports the TKOPTIONNULLOK

flag. SSTTOORRAAGGEE MMAANNAAGGEEMMEENNTT IISSSSUUEESS If a field of a widget record has its offset stored in the objOffset or internalOffset field of a TkOptionSpec structure then the procedures described here will handle all of the storage allocation and resource management issues associated with the field. When the value of an

pin s hne, TkSetOptions o TkFreeSavedOptions) il uoa-

ically free any resources associated with the old value, such as

TkFonts for TKOPTIONFONT options or dynamically allocated memory for

TKOPTIONSTRING options. For an option stored as an object using the

objOffset field of a TkOptionSpec, the widget record shares the object

one t b te bv au fo te al o TkSetOptions Te e-

erence count for this object is incremented when a pointer to it is

stored in the widget record and decremented when the option is modi-

id We te igt s eee TkFreeConfigOptions sol b invoked; it will free the resources associated with all options and decrement reference counts for any objects. However, the widget code is responsible for storing NULL or NNoonnee in all one ad oe fed bfr ivkn TkInitOptions. hs s needed to allow proper cleanup in the rare case where an error occurs n TkInitOptions OOBBJJOOFFFFSSEETT VVSS.. IINNTTEERRNNAALLOOFFFFSSEETT In most cases it is simplest to use the internalOffset field of a TkOptionSpec structure and not the objOffset field. This makes the internal form of the value immediately available to the widget code so the value doesn't have to be extracted from an object each time it is

used. However, there are two cases where the objOffset field is use-

ful. The first case is for TKOPTIONPIXELS options. In this case,

the internal form is an integer pixel value that is valid only for a particular screen. If the value of the option is retrieved, it will be

returned as a simple number. For example, after the command ..bb ccoonnffiigg-

uurree -bboorrddeerrwwiiddtthh 22mm, the command ..bb ccoonnffiigguurree -bboorrddeerrwwiiddtthh might return

7, which is the integer pixel value corresponding to 22mm. Unfortu-

nately, this loses the original screen-independent value. Thus for

TKOPTIONPIXELS options it is better to use the objOffset field. In

this case the original value of the option is retained in the object and can be returned when the option is retrieved. In most cases it is convenient to use the internalOffset field field as well, so that the integer value is immediately available for use in the widget code (alternatively, TTkkGGeettPPiixxeellssFFrroommOObbjj can be used to extract the integer value from the object whenever it is needed). Note: the problem of

losing information on retrievals exists only for TKOPTIONPIXELS

options. The second reason to use the objOffset field is in order to implement new types of options not supported by these procedures. To implement a

new type of option, you can use TKOPTIONSTRING as the type in the

TkOptionSpec structure and set the objOffset field but not the inter-

aOfe fed Te, fe clig TkSetOptions cnet h ojc to internal form yourself. CCUUSSTTOOMM OOPPTTIIOONN TTYYPPEESS

Applications can extend the built-in configuration types with addi-

tional configuration types by writing procedures to parse, print, free, and restore saved copies of the type and creating a structure pointing to those procedures: typedef struct TkObjCustomOption { char *name; TkCustomOptionSetProc *setProc; TkCustomOptionGetProc *getProc; TkCustomOptionRestoreProc *restoreProc; TkCustomOptionFreeProc *freeProc; ClientData clientData; } TkObjCustomOption; typedef int TkCustomOptionSetProc( ClientData clientData, TclInterp *interp, TkWindow tkwin, TclObj **valuePtr, char *recordPtr, int internalOffset, char *saveInternalPtr, int flags); typedef TclObj *TkCustomOptionGetProc( ClientData clientData, TkWindow tkwin, char *recordPtr, int internalOffset); typedef void TkCustomOptionRestoreProc( ClientData clientData, TkWindow tkwin, char *internalPtr, char *saveInternalPtr); typedef void TkCustomOptionFreeProc( ClientData clientData, TkWindow tkwin, char *internalPtr); The TkObjCustomOption structure contains six fields: a name for the custom option type; pointers to the four procedures; and a clientData value to be passed to those procedures when they are invoked. The clientData value typically points to a structure containing information that is needed by the procedures when they are parsing and printing options. RestoreProc and freeProc may be NULL, indicating that no function should be called for those operations. h strc rcdr i ivkd y TkSetOptions o ovr a cOj into an internal representation and store the resulting value in the widget record. The arguments are: clientData A copy of the clientData field in the TkObjCustomOption structure. interp A pointer to a Tcl interpreter, used for error reporting. ki A oy f h twn ruet o TkSetOptions valuePtr A pointer to a reference to a TclObj describing the new value for the option; it could have been specified xlcty n h cl t TkSetOptions o i cud oe from the option database or a default. If the objOffset

for the option is non-negative (the option value is

stored as a (TclObj *) in the widget record), the TclObj pointer referenced by valuePtr is the pointer that will be stored at the objOffset for the option. SetProc may modify the value if necessary; for example, setProc may change the value to NULL to support the

TKOPTIONNULLOK flag.

recordPtr A pointer to the start of the widget record to modify. internalOffset Offset in bytes from the start of the widget record to the location where the internal representation of the option value is to be placed. saveInternalPtr A pointer to storage allocated in a TkSavedOptions structure for the internal representation of the original option value. Before setting the option to its new

value, setProc should set the value referenced by saveIn-

ternalPtr to the original value of the option in order to upr TkRestoreSavedOptions. flags A copy of the flags field in the TkOptionSpec structure for the option SetProc returns a standard Tcl result: TCLOK to indicate successful

processing, or TCLERROR to indicate a failure of any kind. An error

message may be left in the Tcl interpreter given by interp in the case of an error.

h gtrc rcdr i ivkd y TkGetOptionValue n TkGetOption-

IInnffoo to retrieve a TclObj representation of the internal representa-

tion of an option. The clientData argument is a copy of the clientData field in the TkObjCustomOption structure. Tkwin is a copy of the ki agmn t TkGetOptionValue o TkGetOptionInfo. eodt i

a pointer to the beginning of the widget record to query. InternalOff-

set is the offset in bytes from the beginning of the widget record to the location where the internal representation of the option value is stored. GetProc must return a pointer to a TclObj representing the value of the option. h rsoerc rcdr i ivkd y TkRestoreSavedOptions o restore a previously saved internal representation of a custom option value. The clientData argument is a copy of the clientData field in

the TkObjCustomOption structure. Tkwin is a copy of the tkwin argu-

et o TkGetOptionValue r TkGetOptionInfo ItraPr s pointer to the location where internal representation of the option value is stored. SaveInternalPtr is a pointer to the saved value. RestoreProc must copy the value from saveInternalPtr to internalPtr to restore the value. RestoreProc need not free any memory associated with either internalPtr or saveInternalPtr; freeProc will be invoked to free that memory if necessary. RestoreProc has no return value. h fePo poeue s noe b TkSetOptions ad TkFreeSavedOp ttiioonnss to free any storage allocated for the internal representation of a custom option. The clientData argument is a copy of the clientData field in the TkObjCustomOption structure. Tkwin is a copy of the ki agmn t TkGetOptionValue o TkGetOptionInfo. nenlt is a pointer to the location where the internal representation of the option value is stored. The freeProc must free any storage associated with the option. FreeProc has no return value. KKEEYYWWOORRDDSS anchor, bitmap, boolean, border, color, configuration option, cursor,

double, font, integer, justify, pixels, relief, screen distance, syn-

onym Tk 8.1 TkSetOptions(3)




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