Application Icon

From Lazarus wiki
Jump to navigationJump to search

Deutsch (de) English (en) español (es) 日本語 (ja) português (pt)

The application icon is usually displayed on the main window of the application, and it can be controlled by setting Application.Icon

To change the icon of the executable itself, it is necessary to employ a platform-dependent technique.

Setting the Application Icon on Windows

[Translated from Portugues version]

1. Create a new file named "project.rc" (for example) containing: MAINICON ICON "editor.ico"

2. Compile with (Caution : Path must be set correctly): windres -i project.rc -o project.res

3. Include in you projet *.lpr file the following instruction: {$R project.res}

Work with version 0.9.20 and above.

Setting the Application Icon on Mac OS X

Under Mac OS X it is necessary to set an icon for the Application Bundle. This is done by adding a field to the Info.plist file, like this:

  <key>CFBundleIconFile</key>
  <string>iconfile.icns</string>

Where iconfile.icns is located inside MyBundle.app/Contents/Resources

You can find instructions to create an icns file here

Setting the Application Icon on Linux

Under Linux application icons are located in special directories which are different on each Window Manager. The structure inside that directory, however, is standarized and described on the Icon Theme Specification

K Desktop Environment (KDE)

You can find the directory for application icons for use by all users and for each user using the command:

kde-config --path icon

This should print a list of colon-separated paths to stdout.

GNOME

You can find the directory for application icons for use by all users and for each user using the command:

gnome-config --datadir

This should print a path to stdout, inside which is found a directory called pixmaps that attends to the Icon Theme Specification.