Re: How wide can a widget get ?



The 16 bit integer used by X for dimensions limits you to 32k. Once your line gets longer than that, the results are unpredictable, so you will need to clip it. You may want to restrict the scrolled region too, if you're using a scrolled window.

Rob

Paul Pogonyshev wrote:
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

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


--
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 It is easier to get forgiveness than permission.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Rob Clack                        Acedb Development,  Informatics Group
 email: rnc sanger ac uk                Wellcome Trust Sanger Institute
 Tel: +44 1223 494883                   Wellcome Trust Genome Campus
 Fax: +44 1223 494919                   Hinxton  Cambridge    CB10 1SA



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