Personal tools
You are here: Home 文档中心 教程 把你的程序加入到系统托盘里 简介
Document Actions

简介

介绍"系统托盘"/"通知区域"的基本概念。

yangh

介绍如何写一个支持系统通知功能的 GNOME 程序,也就是在通知区域显示一个小图标,用于显示程序状态或提供快捷菜单。
Page 1 of 3.

"系统托盘"是一个运行在指定的 X 屏幕(注1)上的应用程序,它显示由其它正在运行的应用程序提供的小图标,以此来提供通知功能。在 Windows XP 里称之为"通知区域"。受 KDE 的启发,在 Freedesktop 上的 "系统托盘协议规范":http://freedesktop.org/wiki/Standards_2fsystemtray_2dspec 中使用"系统托盘(System Tray)" 这一称法,所以我在此文中也称之为"系统托盘"。

在 GNOME 桌面系统中,系统托盘显示在桌面上的菜单栏(gnome-panel)上,如果你的菜单栏上默认没有"系统托盘",那么可以通过右键点菜单栏->添加到菜单栏...,然后选择"系统通知区域“来添加。

我们常见的使用了系统托盘的应用程序有:"星际译王":http://stardict.sourceforge.net/, Gaim , LumaQQ 等。如下图:

GNOME system tray

注1: Xwindow 系统可以同时支持多个屏幕。

资料:

System Tray Protocol Specification

http://standards.freedesktop.org/systemtray-spec/0.2/

gnome-panel 中通知区域的实现

http://cvs.gnome.org/viewcvs/gnome-panel/applets/notification_area/

应用程序中要用的 tray 代码

http://cvs.gnome.org/viewcvs/libegg/libegg/tray/

 
by yangh last modified Oct 11, 2005 12:40 AM