moving subwindow

Al'miev Il'dar dria1 at yandex.ru
Tue Mar 8 10:46:07 PST 2011


Hello, I am trying to write Xlib-program that would produce a window (main window) on the screen (root screen) and the subwindow inside the main window. To make that, the following Xlib-functions are called (the question is below):

 window = XCreateSimpleWindow ( display,
     RootWindow ( display, screen_number ),
     X, Y,WIDTH,HEIGHT,BORDER_WIDTH,
     BlackPixel ( display, screen_number ),
     WhitePixel ( display, screen_number ) );

 SetWindowManagerHints ( display, PRG_CLASS, argv, argc,
   window, X, Y, WIDTH, HEIGHT, WIDTH_MIN,
   HEIGHT_MIN, TITLE, ICON_TITLE, 0 );

 XSelectInput ( display, window, ExposureMask | KeyPressMask );

 XMapWindow ( display, window );

 window1 = XCreateSimpleWindow ( display,  window,
     (X+5), (Y+5), (int)(WIDTH/3.), (int)(HEIGHT/2.), (int)(BORDER_WIDTH),
     BlackPixel ( display, screen_number ),
     WhitePixel ( display, screen_number ) );

 SetWindowManagerHints ( display, PRG_CLASS, argv, argc,
   window1, (X+5), (Y+5), (int)(WIDTH/3.), (int)(HEIGHT/3.), (int)(WIDTH_MIN),
   (int)(HEIGHT_MIN/3.), TITLE1, ICON_TITLE, 0 );

 XSelectInput ( display, window1, ExposureMask | KeyPressMask );

 XMapWindow ( display, window1 );

These commands produce the main window and the subwindow with the borders specified. However, the subwindow can not be moved inside the main window by dragging it with a mouse. The windows manager is attached only to the main window, and I guess not to the subwindow.

Could anybody help to resolve these problem: that is, how the code should be modified in order to achieve moving the subwindow inside the main window ?

I also attach the the example code.

Thank you.

Il'dar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example1.c
Type: text/x-c
Size: 3618 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20110308/c942e8e8/attachment.bin>


More information about the xorg mailing list