summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXBitmap.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2023-07-23 19:54:43 (GMT)
committerfvogel <fvogelnew1@free.fr>2023-07-23 19:54:43 (GMT)
commitff75af9fa27175c1e403160473d7d54d3084f0de (patch)
tree9257f596c45a3dcfe09ddece8275ba7d07e95f91 /macosx/tkMacOSXBitmap.c
parent2578907b6d13c1aa3f8252dc609a0fc420c18dba (diff)
downloadtk-ff75af9fa27175c1e403160473d7d54d3084f0de.zip
tk-ff75af9fa27175c1e403160473d7d54d3084f0de.tar.gz
tk-ff75af9fa27175c1e403160473d7d54d3084f0de.tar.bz2
Fix [f24725b545]: Aqua: do not treat FourCC as pointer in TkpCreateNativeBitmap(). Patch from Christopher Chavez. Also remove the now unused macro OSTYPE_TO_UTI.
Diffstat (limited to 'macosx/tkMacOSXBitmap.c')
-rw-r--r--macosx/tkMacOSXBitmap.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/macosx/tkMacOSXBitmap.c b/macosx/tkMacOSXBitmap.c
index 29ad97e..f9827c9 100644
--- a/macosx/tkMacOSXBitmap.c
+++ b/macosx/tkMacOSXBitmap.c
@@ -50,9 +50,6 @@ static BuiltInIcon builtInIcons[] = {
#define builtInIconSize 32
-#define OSTYPE_TO_UTI(x) ((NSString *)UTTypeCreatePreferredIdentifierForTag( \
- kUTTagClassOSType, UTCreateStringForOSType(x), nil))
-
static Tcl_HashTable iconBitmapTable = {};
typedef struct {
int kind, width, height;
@@ -175,7 +172,7 @@ TkpCreateNativeBitmap(
Display *display,
const void *source) /* Info about the icon to build. */
{
- NSString *filetype = [NSString stringWithUTF8String:(char *)source];
+ NSString *filetype = TkMacOSXOSTypeToUTI(PTR2UINT(source));
NSImage *iconImage = TkMacOSXIconForFileType(filetype);
CGSize size = CGSizeMake(builtInIconSize, builtInIconSize);
Pixmap pixmap = PixmapFromImage(display, iconImage, size);