Create a window without Minimize, Maximize, Restore buttons

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Create a window without Minimize, Maximize, Restore buttons

woapxp
Dear all,
To whom who have worked with X11 programming, I have been stuck in small question and I cannot resolved it yet. Please give me a help if you have dealt with this problem before.

The question is: how to create a window (using X11 lib) without Minimize, Maximize, Restore, buttons at the top-right of the created window; without "X" icon at the top-left of the created window?

Thanks indeed,

woapxp
Reply | Threaded
Open this post in threaded view
|

Re: Create a window without Minimize, Maximize, Restore buttons

Matthieu Herrb
woapxp wrote:
> Dear all,
> To whom who have worked with X11 programming, I have been stuck in small
> question and I cannot resolved it yet. Please give me a help if you have
> dealt with this problem before.
>
> The question is: how to create a window (using X11 lib) without Minimize,
> Maximize, Restore, buttons at the top-right of the created window; without
> "X" icon at the top-left of the created window?
>

This is done via the window manager hints. See the XAllocSizeHints()
manual page and the related functions.

Also note that these are only hints to the window manager. Some of them
will obey the hints, other wont.

Most higher level toolkits (Gtk+, Qt, ...) have their own functions to
manage the WM Hints and in this case you should avoid using Xlib directly.
--
Matthieu Herrb

Reply | Threaded
Open this post in threaded view
|

Re: Create a window without Minimize, Maximize, Restore buttons

woapxp
Dear Matthieu Herrb,

Thanks for your support. But I still cannot find out the  way to result it. The way of my approach can be described as follow:
1. Create a simple window

win = XCreateSimpleWindow(display,
RootWindow(display,screen),
x, y, width, height,
border_width,
BlackPixel(display,screen),
WhitePixel(display,screen));

2. Set value for XSizeHints variable:


XSizeHints size_hints;
memset(&Size_hints,0,sizeof(XSizeHints);
       size_hints.flags = PPosition | PSize | PMinSize;

        size_hints.x = x;
        size_hints.y = y;
        size_hints.width = width;
        size_hints.height = height;
        size_hints.min_width = some_val;
        size_hints.min_height = some_val;

3. Set standard properties for the window:

XSetStandardProperties(display, win, window_name,
NULL,NULL, argv, argc,&size_hints);


I just can do that by using XSizeHints. I cannot find more information about the detail of the window like Minimize, Maximize, Restore buttons.
What is wrong in my approach of creating a required window? Please give me more your opinion.

Thanks and regards,

woapxp

Matthieu Herrb wrote
woapxp wrote:
> Dear all,
> To whom who have worked with X11 programming, I have been stuck in small
> question and I cannot resolved it yet. Please give me a help if you have
> dealt with this problem before.
>
> The question is: how to create a window (using X11 lib) without Minimize,
> Maximize, Restore, buttons at the top-right of the created window; without
> "X" icon at the top-left of the created window?
>

This is done via the window manager hints. See the XAllocSizeHints()
manual page and the related functions.

Also note that these are only hints to the window manager. Some of them
will obey the hints, other wont.

Most higher level toolkits (Gtk+, Qt, ...) have their own functions to
manage the WM Hints and in this case you should avoid using Xlib directly.
--
Matthieu Herrb