summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>1999-12-03 07:14:39 (GMT)
committerhobbs <hobbs>1999-12-03 07:14:39 (GMT)
commitd58480113f888b1a520818358c62893aeae25c6c (patch)
treebf8df5c959f00e736c3b4ffb64f62d16ff24623f /generic
parentf31814137ad1941e43510e929ec55ea8a96bdfd0 (diff)
downloadtk-d58480113f888b1a520818358c62893aeae25c6c.zip
tk-d58480113f888b1a520818358c62893aeae25c6c.tar.gz
tk-d58480113f888b1a520818358c62893aeae25c6c.tar.bz2
* generic/tkInt.h:
* generic/tkWindow.c: * generic/tkCmds.c: converted Tk_DestroyCmd, Tk_LowerCmd and Tk_RaiseCmd to their ObjCmd equivalent.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkCmds.c62
-rw-r--r--generic/tkInt.h17
-rw-r--r--generic/tkWindow.c8
3 files changed, 45 insertions, 42 deletions
diff --git a/generic/tkCmds.c b/generic/tkCmds.c
index c0b8c9e..75504bb 100644
--- a/generic/tkCmds.c
+++ b/generic/tkCmds.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkCmds.c,v 1.7 1999/10/29 03:57:56 hobbs Exp $
+ * RCS: @(#) $Id: tkCmds.c,v 1.8 1999/12/03 07:14:39 hobbs Exp $
*/
#include "tkPort.h"
@@ -385,7 +385,7 @@ TkFreeBindingTags(winPtr)
/*
*----------------------------------------------------------------------
*
- * Tk_DestroyCmd --
+ * Tk_DestroyObjCmd --
*
* This procedure is invoked to process the "destroy" Tcl command.
* See the user documentation for details on what it does.
@@ -400,19 +400,19 @@ TkFreeBindingTags(winPtr)
*/
int
-Tk_DestroyCmd(clientData, interp, argc, argv)
+Tk_DestroyObjCmd(clientData, interp, objc, objv)
ClientData clientData; /* Main window associated with
* interpreter. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
{
Tk_Window window;
Tk_Window tkwin = (Tk_Window) clientData;
int i;
- for (i = 1; i < argc; i++) {
- window = Tk_NameToWindow(interp, argv[i], tkwin);
+ for (i = 1; i < objc; i++) {
+ window = Tk_NameToWindow(interp, Tcl_GetString(objv[i]), tkwin);
if (window == NULL) {
Tcl_ResetResult(interp);
continue;
@@ -434,7 +434,7 @@ Tk_DestroyCmd(clientData, interp, argc, argv)
/*
*----------------------------------------------------------------------
*
- * Tk_LowerCmd --
+ * Tk_LowerObjCmd --
*
* This procedure is invoked to process the "lower" Tcl command.
* See the user documentation for details on what it does.
@@ -450,37 +450,37 @@ Tk_DestroyCmd(clientData, interp, argc, argv)
/* ARGSUSED */
int
-Tk_LowerCmd(clientData, interp, argc, argv)
+Tk_LowerObjCmd(clientData, interp, objc, objv)
ClientData clientData; /* Main window associated with
* interpreter. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
{
Tk_Window mainwin = (Tk_Window) clientData;
Tk_Window tkwin, other;
- if ((argc != 2) && (argc != 3)) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " window ?belowThis?\"", (char *) NULL);
+ if ((objc != 2) && (objc != 3)) {
+ Tcl_WrongNumArgs(interp, 1, objv, "window ?belowThis?");
return TCL_ERROR;
}
- tkwin = Tk_NameToWindow(interp, argv[1], mainwin);
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[1]), mainwin);
if (tkwin == NULL) {
return TCL_ERROR;
}
- if (argc == 2) {
+ if (objc == 2) {
other = NULL;
} else {
- other = Tk_NameToWindow(interp, argv[2], mainwin);
+ other = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), mainwin);
if (other == NULL) {
return TCL_ERROR;
}
}
if (Tk_RestackWindow(tkwin, Below, other) != TCL_OK) {
- Tcl_AppendResult(interp, "can't lower \"", argv[1], "\" below \"",
- argv[2], "\"", (char *) NULL);
+ Tcl_AppendResult(interp, "can't lower \"", Tcl_GetString(objv[1]),
+ "\" below \"", (other ? Tcl_GetString(objv[2]) : ""),
+ "\"", (char *) NULL);
return TCL_ERROR;
}
return TCL_OK;
@@ -489,7 +489,7 @@ Tk_LowerCmd(clientData, interp, argc, argv)
/*
*----------------------------------------------------------------------
*
- * Tk_RaiseCmd --
+ * Tk_RaiseObjCmd --
*
* This procedure is invoked to process the "raise" Tcl command.
* See the user documentation for details on what it does.
@@ -505,37 +505,37 @@ Tk_LowerCmd(clientData, interp, argc, argv)
/* ARGSUSED */
int
-Tk_RaiseCmd(clientData, interp, argc, argv)
+Tk_RaiseObjCmd(clientData, interp, objc, objv)
ClientData clientData; /* Main window associated with
* interpreter. */
Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
- char **argv; /* Argument strings. */
+ int objc; /* Number of arguments. */
+ Tcl_Obj *CONST objv[]; /* Argument objects. */
{
Tk_Window mainwin = (Tk_Window) clientData;
Tk_Window tkwin, other;
- if ((argc != 2) && (argc != 3)) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
- argv[0], " window ?aboveThis?\"", (char *) NULL);
+ if ((objc != 2) && (objc != 3)) {
+ Tcl_WrongNumArgs(interp, 1, objv, "window ?aboveThis?");
return TCL_ERROR;
}
- tkwin = Tk_NameToWindow(interp, argv[1], mainwin);
+ tkwin = Tk_NameToWindow(interp, Tcl_GetString(objv[1]), mainwin);
if (tkwin == NULL) {
return TCL_ERROR;
}
- if (argc == 2) {
+ if (objc == 2) {
other = NULL;
} else {
- other = Tk_NameToWindow(interp, argv[2], mainwin);
+ other = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), mainwin);
if (other == NULL) {
return TCL_ERROR;
}
}
if (Tk_RestackWindow(tkwin, Above, other) != TCL_OK) {
- Tcl_AppendResult(interp, "can't raise \"", argv[1], "\" above \"",
- argv[2], "\"", (char *) NULL);
+ Tcl_AppendResult(interp, "can't raise \"", Tcl_GetString(objv[1]),
+ "\" above \"", (other ? Tcl_GetString(objv[2]) : ""),
+ "\"", (char *) NULL);
return TCL_ERROR;
}
return TCL_OK;
diff --git a/generic/tkInt.h b/generic/tkInt.h
index 7e43724..c79c55c 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: $Id: tkInt.h,v 1.17 1999/11/17 02:38:27 ericm Exp $
+ * RCS: $Id: tkInt.h,v 1.18 1999/12/03 07:14:39 hobbs Exp $
*/
#ifndef _TKINT
@@ -899,8 +899,9 @@ EXTERN int Tk_ChooseDirectoryObjCmd _ANSI_ARGS_((
EXTERN int Tk_ChooseFontObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
-EXTERN int Tk_DestroyCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+EXTERN int Tk_DestroyObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
EXTERN int Tk_EntryObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
@@ -936,8 +937,9 @@ EXTERN int Tk_LabelObjCmd _ANSI_ARGS_((ClientData clientData,
EXTERN int Tk_ListboxObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
-EXTERN int Tk_LowerCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+EXTERN int Tk_LowerObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
EXTERN int Tk_MenubuttonObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
@@ -955,8 +957,9 @@ EXTERN int Tk_PlaceCmd _ANSI_ARGS_((ClientData clientData,
EXTERN int Tk_RadiobuttonObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
-EXTERN int Tk_RaiseCmd _ANSI_ARGS_((ClientData clientData,
- Tcl_Interp *interp, int argc, char **argv));
+EXTERN int Tk_RaiseObjCmd _ANSI_ARGS_((ClientData clientData,
+ Tcl_Interp *interp, int objc,
+ Tcl_Obj *CONST objv[]));
EXTERN int Tk_ScaleObjCmd _ANSI_ARGS_((ClientData clientData,
Tcl_Interp *interp, int objc,
Tcl_Obj *CONST objv[]));
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 1c61446..7e4d5fc 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWindow.c,v 1.11 1999/11/17 02:38:28 ericm Exp $
+ * RCS: @(#) $Id: tkWindow.c,v 1.12 1999/12/03 07:14:39 hobbs Exp $
*/
#include "tkPort.h"
@@ -101,18 +101,18 @@ static TkCmd commands[] = {
{"bind", Tk_BindCmd, NULL, 1, 1},
{"bindtags", Tk_BindtagsCmd, NULL, 1, 1},
{"clipboard", Tk_ClipboardCmd, NULL, 0, 1},
- {"destroy", Tk_DestroyCmd, NULL, 1, 1},
+ {"destroy", NULL, Tk_DestroyObjCmd, 1, 1},
{"event", NULL, Tk_EventObjCmd, 1, 1},
{"focus", NULL, Tk_FocusObjCmd, 1, 1},
{"font", NULL, Tk_FontObjCmd, 1, 1},
{"grab", Tk_GrabCmd, NULL, 0, 1},
{"grid", Tk_GridCmd, NULL, 1, 1},
{"image", NULL, Tk_ImageObjCmd, 1, 1},
- {"lower", Tk_LowerCmd, NULL, 1, 1},
+ {"lower", NULL, Tk_LowerObjCmd, 1, 1},
{"option", Tk_OptionCmd, NULL, 1, 1},
{"pack", Tk_PackCmd, NULL, 1, 1},
{"place", Tk_PlaceCmd, NULL, 1, 1},
- {"raise", Tk_RaiseCmd, NULL, 1, 1},
+ {"raise", NULL, Tk_RaiseObjCmd, 1, 1},
{"selection", Tk_SelectionCmd, NULL, 0, 1},
{"tk", NULL, Tk_TkObjCmd, 0, 1},
{"tkwait", Tk_TkwaitCmd, NULL, 1, 1},