Re: How wide can a widget get ?



John Cupitt wrote (on 23 November):
Hi,

On Tue, 23 Nov 2004 02:51:25 -0700, Nix N. Nix <nix go-nix ca> wrote:
What's the maximum width I can set a widget to ? I end up attempting to
set the width of one of my drawing area widgets to 66327, and it doesn't
seem to want to go that wide. Is there an inherent limit to the width of
a widget ?

There was in gtk+-1.2, but gtk2 (pretty much) removed this. I have
drawing areas in my app which go up to several million pixels in each
axis and gtk scrolls them fine. Memory isn't allocated for invisible
pixels, so there's no limit there either.

You can have problems with a 16 bit coordinate limit on drawing
operations on very large drawing areas: you may need to do some
clipping yourself.

Can you please explain this further?  (Sample code would be especially
helpful.)  Here is one particular example that causes problems:

        gdk_draw_line (window, gc, 20, 20, 20, 40000);

Instead of going downwards, the line goes upwards (seems like X
considers 40000 to be a negative 16-bit number.)

I can cope with this particular example just fine, but what if the
user scrolls the window right to the "sign flip frontier"?

The very reason why I use such horribly large windows is that they
have a pixmap background and I like it to be scrolled.  I couldn't
find a way to adjust background origin instead of scrolling the
window... :(

Paul




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