diff options
author | jingham <jingham> | 1999-03-22 06:44:26 (GMT) |
---|---|---|
committer | jingham <jingham> | 1999-03-22 06:44:26 (GMT) |
commit | e9780702858d7d86b26472d4ed1b33c934ae6972 (patch) | |
tree | 700b329655716d2cb9a3e04793db44f9d05001b4 | |
parent | e3a6ea80e34ca8cbadb99d4bcdea3d964a9c5799 (diff) | |
download | tk-e9780702858d7d86b26472d4ed1b33c934ae6972.zip tk-e9780702858d7d86b26472d4ed1b33c934ae6972.tar.gz tk-e9780702858d7d86b26472d4ed1b33c934ae6972.tar.bz2 |
winfo server used to crash on the Mac. Get the MacOS version and return that instead.
-rw-r--r-- | mac/tkMacXStubs.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/mac/tkMacXStubs.c b/mac/tkMacXStubs.c index ba25207..e18efe9 100644 --- a/mac/tkMacXStubs.c +++ b/mac/tkMacXStubs.c @@ -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: tkMacXStubs.c,v 1.3 1998/09/14 18:23:40 stanton Exp $ + * RCS: @(#) $Id: tkMacXStubs.c,v 1.3.2.1 1999/03/22 06:44:26 jingham Exp $ */ #include "tkInt.h" @@ -22,6 +22,7 @@ #include <Xatom.h> +#include <Gestalt.h> #include <Windows.h> #include <Fonts.h> #include <QDOffscreen.h> @@ -541,13 +542,17 @@ TkGetServerInfo( Tk_Window tkwin) /* Token for window; this selects a * particular display and server. */ { - char buffer[50], buffer2[50]; - - sprintf(buffer, "X%dR%d ", ProtocolVersion(Tk_Display(tkwin)), - ProtocolRevision(Tk_Display(tkwin))); - sprintf(buffer2, " %d", VendorRelease(Tk_Display(tkwin))); - Tcl_AppendResult(interp, buffer, ServerVendor(Tk_Display(tkwin)), - buffer2, (char *) NULL); + char buffer[50]; + long result; + short low, major, minor, micro; + + Gestalt(gestaltSystemVersion, &result); + low = LoWord(result); + major = (low & 0x0F00) >> 8; + minor = (low & 0x00F0) >> 4; + micro = (low & 0x000F); + sprintf(buffer, "MacOS %d.%d.%d", major, minor, micro); + Tcl_AppendResult(interp, buffer, (char *) NULL); } /* * Image stuff |