tk(fileicon) Tk tk(fileicon)

```

```

# [NAME](#NAME)

fileicon - Platform-native icon image for file type/extension.

# [SYNOPSIS](#SYNOPSIS)

**tk fileicon file size**

```

```

# [DESCRIPTION](#DESCRIPTION)

The **tk fileicon** command creates a platform-specific file icon. Its intent is to provide a visual representation of a file type that is expected by users on that platform. The command takes two arguments - an aboslute file path and an icon size, which be any size (on Windows these map to the closest of 16, 32, 48 or 256 pixels because of API constraints).

# [EXAMPLE](#EXAMPLE)

Here is an example of the **tk fileicon** code:

```
set img [tk fileicon [file normalize text.txt] 32]
pack [label .l -text "text.txt" -image $img -compound top]
```

# [PLATFORM NOTES](#PLATFORM_NOTES)

On Windows and macOS, system API's are used; on X11, icons from the Tango project - the default icon theme for the Gnome desktop - are used.

# [KEYWORDS](#KEYWORDS)

image, icon

n

---

Document: fileicon(n) from tk 9.1.0-r0 (Chainguard OS)
Source: https://downloads.sourceforge.net/sourceforge/tcl/tk9.1.0-src.tar.gz
