diff options
author | hobbs <hobbs@noemail.net> | 2001-08-29 23:22:24 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2001-08-29 23:22:24 (GMT) |
commit | 6dc25f52d9a5af9d6cbcaaa51083bb491a0fa3e9 (patch) | |
tree | b404a0f0e067dd1a6d688e026ad74d4ead531b81 /generic/tkScale.c | |
parent | de90f2b8b90cb13b45977b214fe3a1585e36d377 (diff) | |
download | tk-6dc25f52d9a5af9d6cbcaaa51083bb491a0fa3e9.zip tk-6dc25f52d9a5af9d6cbcaaa51083bb491a0fa3e9.tar.gz tk-6dc25f52d9a5af9d6cbcaaa51083bb491a0fa3e9.tar.bz2 |
* tests/config.test: added config-14.1 to test namespace import
evaluation of widgets.
* generic/tkButton.c (ButtonCreate):
* generic/tkFrame.c (CreateFrame):
* generic/tkMenubutton.c (Tk_MenubuttonObjCmd):
* generic/tkPlace.c (Tk_PlaceObjCmd):
* generic/tkScale.c (Tk_ScaleObjCmd):
* generic/tkMessage.c (Tk_MessageObjCmd):
* generic/tkEntry.c (Tk_EntryObjCmd, Tk_SpinboxObjCmd):
* generic/tkSquare.c (SquareObjCmd): redid the handling of
optionTables in widgets to allow them to be imported into other
namespaces. [Bug #456632]
FossilOrigin-Name: eb203000eca11b77c0a57bb772c4ffef94889710
Diffstat (limited to 'generic/tkScale.c')
-rw-r--r-- | generic/tkScale.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/generic/tkScale.c b/generic/tkScale.c index 8327ab7..1be68ec 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -18,7 +18,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkScale.c,v 1.13 2000/11/22 01:49:38 ericm Exp $ + * RCS: @(#) $Id: tkScale.c,v 1.14 2001/08/29 23:22:24 hobbs Exp $ */ #include "tkPort.h" @@ -211,7 +211,7 @@ static Tk_ClassProcs scaleClass = { int Tk_ScaleObjCmd(clientData, interp, objc, objv) - ClientData clientData; /* Either NULL or pointer to option table. */ + ClientData clientData; /* NULL. */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ Tcl_Obj *CONST objv[]; /* Argument values. */ @@ -220,25 +220,6 @@ Tk_ScaleObjCmd(clientData, interp, objc, objv) Tk_OptionTable optionTable; Tk_Window tkwin; - optionTable = (Tk_OptionTable) clientData; - if (optionTable == NULL) { - Tcl_CmdInfo info; - char *name; - - /* - * We haven't created the option table for this widget class - * yet. Do it now and save the table as the clientData for - * the command, so we'll have access to it in future - * invocations of the command. - */ - - optionTable = Tk_CreateOptionTable(interp, optionSpecs); - name = Tcl_GetString(objv[0]); - Tcl_GetCommandInfo(interp, name, &info); - info.objClientData = (ClientData) optionTable; - Tcl_SetCommandInfo(interp, name, &info); - } - if (objc < 2) { Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?"); return TCL_ERROR; @@ -250,6 +231,13 @@ Tk_ScaleObjCmd(clientData, interp, objc, objv) return TCL_ERROR; } + /* + * Create the option table for this widget class. If it has already + * been created, the cached pointer will be returned. + */ + + optionTable = Tk_CreateOptionTable(interp, optionSpecs); + Tk_SetClass(tkwin, "Scale"); scalePtr = TkpCreateScale(tkwin); |