4 * This file contains procedures that manage the input focus.
6 * Copyright (c) 1990-1994 The Regents of the University of California.
7 * Copyright (c) 1994-1995 Sun Microsystems, Inc.
8 * Copyright (c) 1995 Christian Werner
10 * See the file "license.terms" for information on usage and redistribution
11 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
19 *--------------------------------------------------------------
23 * This procedure is invoked to process the "focus" Tcl command.
24 * See the user documentation for details on what it does.
27 * A standard Tcl result.
30 * See the user documentation.
32 *--------------------------------------------------------------
36 Ck_FocusCmd(clientData, interp, argc, argv)
37 ClientData clientData; /* Main window associated with
39 Tcl_Interp *interp; /* Current interpreter. */
40 int argc; /* Number of arguments. */
41 char **argv; /* Argument strings. */
43 CkWindow *winPtr = (CkWindow *) clientData;
44 CkWindow *newPtr, *focusWinPtr;
47 * If invoked with no arguments, just return the current focus window.
51 focusWinPtr = winPtr->mainPtr->focusPtr;
52 if (focusWinPtr != NULL)
53 interp->result = focusWinPtr->pathName;
58 * If invoked with a single argument beginning with "." then focus
63 if (argv[1][0] == 0) {
66 if (argv[1][0] == '.') {
67 newPtr = (CkWindow *) Ck_NameToWindow(interp, argv[1], winPtr);
70 if (!(newPtr->flags & CK_ALREADY_DEAD))
76 Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
77 " ?pathName?\"", (char *) NULL);