Chinaunix首页 | 论坛 | 博客
  • 博客访问: 292796
  • 博文数量: 108
  • 博客积分: 4260
  • 博客等级: 上校
  • 技术积分: 1145
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-21 13:22
文章分类

全部博文(108)

文章存档

2011年(40)

2010年(22)

2009年(17)

2008年(29)

我的朋友

分类: LINUX

2011-08-25 13:42:39

/**
* cc -o memo memo.c -lXm -lXt -lX11 -I/usr/X11R6/include/
-L/usr/X11R6/lib/
*/


#include
#include
#include
#include
#include
#include

void main(int argc, char **argv)
{
Widget shell, msg;
XtAppContext app;
XmString xmstr;
XClientMessageEvent xev;
Display *display;

shell = XtAppInitialize(&app, "Memo", NULL, 0, &argc, argv, NULL,
NULL, 0);

xmstr = XmStringCreateLtoR("move window test",
XmFONTLIST_DEFAULT_TAG);

msg = 
XtVaCreateManagedWidget(
"message", xmLabelWidgetClass, shell, XmNlabelString, xmstr,
NULL);

XmStringFree(xmstr);

XtRealizeWidget(shell);


/* Now move the window to a different area */
display = XtDisplay(shell);


xev.type = ClientMessage;
xev.window = XtWindow(shell);
xev.message_type = XInternAtom(display, "_NET_WM_DESKTOP", False); 
xev.format = 32;

/* Force into desktop 2 */
xev.data.l[0] = 2;


XSendEvent(
display,
RootWindowOfScreen(XtScreen(shell)), 
False, 
SubstructureNotifyMask|SubstructureRedirectMask, 
(XEvent *) &xev);


XtAppMainLoop(app);
}
阅读(386) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~