summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixPort.h11
-rw-r--r--unix/tkUnixXId.c36
2 files changed, 37 insertions, 10 deletions
diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h
index e2895dc..6e51fe7 100644
--- a/unix/tkUnixPort.h
+++ b/unix/tkUnixPort.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: tkUnixPort.h,v 1.6 2001/09/21 21:22:09 hobbs Exp $
+ * RCS: @(#) $Id: tkUnixPort.h,v 1.7 2001/09/25 16:25:20 dgp Exp $
*/
#ifndef _UNIXPORT
@@ -204,14 +204,7 @@ extern int errno;
*/
#define TkpPrintWindowId(buf,w) \
- sprintf((buf), "0x%x", (unsigned int) (w))
-
-/*
- * TkpScanWindowId is just an alias for Tcl_GetInt on Unix.
- */
-
-#define TkpScanWindowId(i,s,wp) \
- Tcl_GetInt((i),(s),(int *)(wp))
+ sprintf((buf), "%#08lx", (unsigned long) (w))
/*
* This macro indicates that entry and text widgets should display
diff --git a/unix/tkUnixXId.c b/unix/tkUnixXId.c
index 6312d3a..c2be145 100644
--- a/unix/tkUnixXId.c
+++ b/unix/tkUnixXId.c
@@ -17,7 +17,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixXId.c,v 1.5 1999/04/21 21:53:32 rjohnson Exp $
+ * RCS: @(#) $Id: tkUnixXId.c,v 1.6 2001/09/25 16:25:20 dgp Exp $
*/
/*
@@ -534,3 +534,37 @@ TkpWindowWasRecentlyDeleted(win, dispPtr)
}
return 0;
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkpScanWindowId --
+ *
+ * Given a string, produce the corresponding Window Id.
+ *
+ * Results:
+ * The return value is normally TCL_OK; in this case *idPtr
+ * will be set to the Window value equivalent to string. If
+ * string is improperly formed then TCL_ERROR is returned and
+ * an error message will be left in the interp's result.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkpScanWindowId(interp, string, idPtr)
+ Tcl_Interp *interp;
+ CONST char *string;
+ Window *idPtr;
+{
+ int value;
+ if (Tcl_GetInt(interp, string, &value) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ *idPtr = (Window) value;
+ return TCL_OK;
+}
+