Re: How To Draw a window without an option to Maximize it



Amitesh Singh <singh amitesh gmail com> wrote:

 How to Draw a Window without an option to Maximize it ?

i have also tried to do the same using gdk_window_set_decorations ();
but its not working !! :(

gdk_window_set_decorations() is basically the right function call to
achieve what you intend, indeed. However, decorations (buttons) like
"maximize", "minimize" and such are maintained and controlled by the
window manager, not by GDK nor GTK.

All this function can do is to "ask" the window manager to set or unset
desired window style properties. It really can't control or enforce the
window manager to honor this request. It's up to the window manager to
pay attention and to style window borders appropriately. It's important
to understand that the window manager is a piece of software which is
completely independent from GTK+ / GDK. The same window manager may also
control Motif or QT based software which may be running concurrently.

As you probably know, there are dozenillions of different window
managers around (in the Unix world). The way and extent to which they
honor decoration requests varies greatly, from complete ignorance
(non-support) to full compliance of all feature combinations.

The window managers of various MS-Windows versions (there's only the
default one for each version of Windows) are known not to fully honor
all combinations of decoration requests, either. They support some
combinations of window features but don't support others.

So if a function call like the above one doesn't produce the correct
result on your machine, then it's a matter of your window manager
(perhaps of the window manager theme you use). It will look correct on
some other machines with other window managers, but there's nothing you
can do to enforce the correct look on all machines. Some window managers
may even offer a user option to never suppress buttons like "maximize"
or "minimize", as some users may prefer to have *all* their windows
resizable and maximizable, whether the application properly supports it
or not.

In general, there should be very few situations when it makes sense to
suppress the maximize button (or resizability) of windows. This is true
for both toplevel and dialog windows. While in the MS Windows world this
artificial restriction of user's freedom has a long tradition, in the
Unix world the opposite is the case, hence the varying support of it.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]