Re: set_resize



2009/1/14 Pietro Battiston <toobaz email it>:
> Hello,
>
> the documentation for gtk_widget_size_request () says:
>
> "Also remember that the size request is not necessarily the size a
> widget will actually be allocated."
>
> While there may be a lot of reasons why a widget doesn't get the area
> requested, I imagine(d) the basic one would be "because there is not
> enough space on the screen for everyone".
>
> Instead, size_requests are indeed fulfilled at cost of greating a window
> much bigger than the screen. Then, I frankly don't see the point of
> set_size_request (but I understand why it's very rarely used!).
>
> I would have filed a bug (asking for windows to clip to screen when
> their their size_request is too big*), but it's obviously a major issue,
> so obviously it can't be true that nobody thought about it.

Clipping a window is dangerous, since it can obscure controls so that
you can't reach them at all any more. If the window expands to
infinity, you can at least move it partially offscreen to reach the
other end.

Forcibly clipping window size would anyway only be band-aid to the
real problem in the application, which can be:
 - it doesn't adapt the size of a window for small screens (a minor,
but unfortunately common issue which can be worked around by moving
the window partially offscreen)
 - it doesn't constrain the size of a dynamically resizing widget
 - it doesn't offer scrolling for a dynamically resizing widget

So while it indeed would be possible, it would be just correcting
design problems of an application in a potentially harmful way.

Although unscalable UI:s are not something I would want to see
supported in any way (I would rather see them fixed than worked
around), one feasible way of not expanding beyond screen size would be
to automatically make gtkwindow to reparent it's child to a
scrolledwindow (or just implementing scrolling itself) if the
size_request would make it bigger than the screen.

One point to notice also is that knowing the size of window
decorations is a window manager dependant feature so it can't really
be trusted to be always available.

-- 
Kalle Vahlman, zuh iki fi
Powered by http://movial.fi
Interesting stuff at http://sandbox.movial.com
See also http://syslog.movial.fi


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