.\" Text automatically generated by txt2man
'\"
'\" Copyright (c) 2025 Kevin Walzer.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
.TH tk fileicon n "" Tk "Tk Built-In Commands"
.so man.macros
.BS
.SH NAME
fileicon \- Platform-native icon image for file type/extension.
.SH SYNOPSIS
\fBtk fileicon\fI file size\fR
.BE
.SH DESCRIPTION
.PP
The \fBtk fileicon\fR 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).
.SH EXAMPLE
.PP
Here is an example of the \fBtk fileicon\fR code:
.PP
.CS
set img [tk fileicon [file normalize text.txt] 32]
pack [label .l -text "text.txt" -image $img -compound top]
.CE
.SH PLATFORM NOTES
.PP
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.
.
.SH KEYWORDS
image, icon
