diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1999-12-07 23:08:10 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1999-12-07 23:08:10 (GMT) |
commit | 8f5725af60cc26787bf61549fc780537f287ebc0 (patch) | |
tree | 9bc93b64dba5256755cbef4c62ca15a84830efd8 /Mac/Python/macmain.c | |
parent | cbdff766d2be1e065c76dc571552ebe3747dcf70 (diff) | |
download | cpython-8f5725af60cc26787bf61549fc780537f287ebc0.zip cpython-8f5725af60cc26787bf61549fc780537f287ebc0.tar.gz cpython-8f5725af60cc26787bf61549fc780537f287ebc0.tar.bz2 |
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).
Diffstat (limited to 'Mac/Python/macmain.c')
-rw-r--r-- | Mac/Python/macmain.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Mac/Python/macmain.c b/Mac/Python/macmain.c index 0fdcb51..db39e18 100644 --- a/Mac/Python/macmain.c +++ b/Mac/Python/macmain.c @@ -37,6 +37,10 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #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 @@ PyMac_PrefRecord options; 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 @@ init_mac_world() InitDialogs((long)0); InitMenus(); InitCursor(); + init_appearance(); #endif } |