X桌面的系统弹出框是如何出来的呢?
是不是得自己写程序来生成一个小窗口显示在那里,再设置一个超时定时器,一段时间后关闭这个窗口呢?
X已经为我们考虑到了这个问题,由libnotify来实现。
首先在ubuntu上安装:
apt-get install libnotify-bin
使用方法:
$ notify-send -u normal "low" "message body"
$ notify-send -u normal "normal" "message body"
$ notify-send -u normal "critical" "message body"
现在虽然使用shell可以出来弹出对话框了,但是直接用C语言编码,还没有出来效果,应用程序在notify_init()中出现core dump。
参考:
http://magicgod.javaeye.com/blog/155783 一个有意思的提示工具
http://blog.csdn.net/absurd/archive/2007/05/17/1613963.aspx 事件管理器设计备忘录