Mercurial > cpython-lru_cache-weakref
diff Mac/Python/macmain.c @ 11529:f83b74273da2 legacy-trunk
First bits and pieces of appearance support: an init routine, a global flag PyMac_AppearanceCompliant (exported thru MacOS). If USE_APPEARANCE
is off the code is disabled (but the variables are still there, set to 0).
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Tue, 07 Dec 1999 23:08:10 +0000 |
| parents | 678a9a79c7e8 |
| children | 51c0c3b6d919 |
line wrap: on
line diff
--- a/Mac/Python/macmain.c Tue Dec 07 21:47:09 1999 +0000 +++ b/Mac/Python/macmain.c Tue Dec 07 23:08:10 1999 +0000 @@ -37,6 +37,10 @@ #include <Windows.h> #include <Fonts.h> #include <Balloons.h> +#ifdef USE_APPEARANCE +#include <Gestalt.h> +#include <Appearance.h> +#endif /* USE_APPEARANCE */ #ifdef __MWERKS__ #include <SIOUX.h> #define USE_SIOUX @@ -64,6 +68,21 @@ static void Py_Main Py_PROTO((int, char **)); /* Forward */ void PyMac_Exit Py_PROTO((int)); /* Forward */ +static void init_appearance() +{ +#ifdef USE_APPEARANCE + OSErr err; + SInt32 response; + + err = Gestalt(gestaltAppearanceAttr,&response); + if ( err ) goto no_appearance; + if ( !(response&(1<<gestaltAppearanceExists)) ) goto no_appearance; + /* XXXX Should we check the version? Compat-mode? */ + PyMac_AppearanceCompliant = 1; +no_appearance: + return; +#endif /* USE_APPEARANCE */ +} /* Initialize the Mac toolbox world */ static void @@ -80,6 +99,7 @@ InitDialogs((long)0); InitMenus(); InitCursor(); + init_appearance(); #endif }
