[pygtk] glade & DrawingArea width limit
luc.lefebvre at mcgill.ca
Wed Jan 28 09:17:30 WST 2004
I am trying to display data sets (in a scrolling window) which contain ~100 000 points. I do this by having a ScrolledWindow with a ViewPort on a DrawingArea. The latter is the size of my data set taking into account scale. This implies that for 12 bit data and 100 000 points at 1/10 scale for x and y a Drawing Area of 410x10000. This seems to work fine. It is when I change scaling (say to 1/2 on x) that things go wonky. On smaller data sets the scaling changes work fine.
I do see your point concerning X requests (by that I assume you are talking about X-windows). I hadn't thought of that, but it makes sense. I suppose I could use a paging mechanism where only one screen of data is plotted at a time in stead of a scrolling display of all of the data or limit the drawingarea size to signed short. I could also have a look at PyOpenGL.
There may be a better way to do this. One would think that the scrolling could trigger a redraw that is updated by drawing new stuff in the drawingarea. I'm not sure how to go about this without having the associated drawingarea be of representative size. I may look into how to change the scrollbar attributes so that the show the proper proportions while the drawing area is the same size as the viewport (or would I then need a viewport at all...).
Any further insight/suggestions welcome.
On Wed, 28 Jan 2004 02:18:50 -0800 (PST)
"Andrew P. Lentvorski, Jr." <bsder at allcaps.org> wrote:
> On Tue, 27 Jan 2004, Luc Lefebvre wrote:
> > Whenever I try to set a DrawingArea widget width > 10000, glade reverts
> > the value to 10000. Oddly enough when I do
> > drawingarea.set_size_request(width,height) it will accept the value but
> > then the drawing appears to go wonky. Is there a limit to the width
> > that one can assign to a DrawingArea widget? Things do seem to break
> > down passed 10000.
> What are you actually trying to do?
> There will be two issues that I can think of right off the bat.
> First, if the DrawingArea is 10,000 x 10,000 square, Gtk immediately
> allocates a backing store of 100,000,000 pixels x 3 bytes/pixel or
> approximately 300 Megabytes right off the top just for the backing store.
> How much memory do you have in your computer?
> Second, X requests generally fail when their values get outside of a
> signed short (-32768/+32767).
> If you really want coordinates that cover that large a dynamic range, you
> probably want to handle that stuff yourself, and you might want to think
> about using PyOpenGL/PyGtkGLExt which can use floating point operands (at
> least 24 bits of precision) or standard integers (normally at least 32
> bits of precision).
In the beginner's mind there are many possibilities,
in the expert's mind there are few. <Shunryu Suzuki>
Key fingerprint = D2E5 5E35 B910 6F4E 0242 EC63 0FD9 96D0 C7F4 784E
More information about the pygtk