diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-11-09 13:41:27 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-11-09 13:41:27 (GMT) |
commit | 3b8a1a19064c05bb314d93d5ce9e2d51efbb5e44 (patch) | |
tree | f18c6b6e8986c8b77eb6445792fa3ab6ec532c2d /win/tkWinMenu.c | |
parent | d923ff63c9b6637fbae77b9dbed6ced704eba82b (diff) | |
download | tk-3b8a1a19064c05bb314d93d5ce9e2d51efbb5e44.zip tk-3b8a1a19064c05bb314d93d5ce9e2d51efbb5e44.tar.gz tk-3b8a1a19064c05bb314d93d5ce9e2d51efbb5e44.tar.bz2 |
Bring all win32 version stuff to one place. Should work the same (should still work on XP, although I don't know if we really want that).
Diffstat (limited to 'win/tkWinMenu.c')
-rw-r--r-- | win/tkWinMenu.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 8e14669..0975633 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -3203,12 +3203,7 @@ SetDefaults( int pointSize; HFONT menuFont; /* See: [Bug #3239768] tk8.4.19 (and later) WIN32 menu font support */ - struct { - NONCLIENTMETRICS metrics; -#if (WINVER < 0x0600) - int padding; -#endif - } nc; + NONCLIENTMETRICS metrics; OSVERSIONINFOW os; /* @@ -3227,17 +3222,17 @@ SetDefaults( } Tcl_DStringInit(&menuFontDString); - nc.metrics.cbSize = sizeof(nc); + metrics.cbSize = sizeof(metrics); os.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); GetVersionExW(&os); if (os.dwMajorVersion < 6) { - nc.metrics.cbSize -= sizeof(int); + metrics.cbSize -= sizeof(int); } - SystemParametersInfo(SPI_GETNONCLIENTMETRICS, nc.metrics.cbSize, - &nc.metrics, 0); - menuFont = CreateFontIndirect(&nc.metrics.lfMenuFont); + SystemParametersInfo(SPI_GETNONCLIENTMETRICS, metrics.cbSize, + &metrics, 0); + menuFont = CreateFontIndirect(&metrics.lfMenuFont); SelectObject(scratchDC, menuFont); GetTextMetricsA(scratchDC, &tm); GetTextFaceA(scratchDC, LF_FACESIZE, faceName); |