Das KDevelop-Programmierhandbuch: Leitfaden zur C++-Anwendungsentwicklung für das K Desktop Environment (KDE) mit Hilfe der KDevelop-IDE in der Version 1.2
Zurück | Kapitel 5. Configuring Menubars and Toolbars | Vor

# 5.3. Integrating Toolbar buttons

Toolbar buttons can be added like menu-entries with the difference that the used method is `insertButton()` and takes a button pixmap and tool-tip text instead of a menu text.

The icons you want to use can be loaded by `KIconLoader`, where `KApplication` offers the macros `ICON()` and `Icon()` to access the icon loader and load the icon. These macros take the filename of the pixmap as their parameter to load the icon from the KDE file system in a certain order (see `KIconLoader` for the search order).

The KDE libraries also offer a set of toolbar buttons that can be used for standard actions. In cases where they don't meet your needs, you will have to paint your own pixmaps. KDevelop supports this by selecting "New" from the "File" menu, then select Pixmap as the file type. Usually you will place your toolbar pixmaps in a project subdirectory "toolbar " and install them into your application specific toolbar directory.

Zurück | Anfang | Vor
Adding a new menu | Hoch | Configuring Statusbars