当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > 启动“gnome-run”对话框

Unix/Linux
如何变更收取的邮件的默认存储位置
如何在虚拟主机中设定sendmail
为什么当系统启动到Sendmail时会暂停
sendmail下如何限制邮件大小
sendmail如何允许某个地址邮件转发
为什么不能配置邮件服务器为openrelay的
为什么访问Javaapplets的时候显示的却是纯文本
如何在日志里面记录apache浏览器和引用信息
为什么我的网站只能从局域网里面访问,Internet上无论哪里都访问不到
为什么apache配置文件里的Options属性没有得到预期的效果
apache如何打开或者关闭列目录功能
如何屏蔽来自某个Internet地址的用户访问Apache服务器
如何使每个用户有独立的cgi-bin目录
先来一篇文章试试
在redhat中建立交换分区
LINUX下的ssh认证,不用密码登陆另一台机器
基于 Linux 的实时系统
量身订作一个OS
使用软式磁碟
对应DOS和Linux中的相关指令

Unix/Linux 中的 启动“gnome-run”对话框


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 40 ::
收藏到网摘: n/a


“gnome-run” 命令在比较新的gnome里已经没有了。只能用编程的方法来做到这一点了。这个是gnome定义的少数几个Atom之一。
void die(const char *message){ fputs(message, stderr); exit(1);}
Atom get_atom(Display *display, const char *atom_name){ Atom atom = XInternAtom(display, atom_name, False); if (atom == None) die("can't find an atom I need"); return atom;}
int main(){ Display *display; Atom gnome_panel_atom, run_atom; XClientMessageEvent event;
display = XOpenDisplay(NULL); if (display == NULL) die("can't open display");
gnome_panel_atom = get_atom(display, "_GNOME_PANEL_ACTION"); run_atom = get_atom(display, "_GNOME_PANEL_ACTION_RUN_DIALOG");
event.type = ClientMessage; event.window = DefaultRootWindow(display); event.message_type = gnome_panel_atom; event.format = 32; event.data.l[0] = run_atom; event.data.l[1] = (Time)0;
XSendEvent(display, event.window, False, StructureNotifyMask, (XEvent *)&event);

XCloseDisplay(display);
return 0;}