[EMAIL PROTECTED] wrote:

I'm trying to write a sequencer (matrix) -widget, but I seem to be hitting
a wall.

I have implemented a matrix editor using 1 large Pixmap displayed in a
gtk.DrawingArea as the grid, and then drawing notes on the
gtk.DrawingArea.window.
This approach, however, becomes so slow it actually crashes X when
handling Pixmaps of some size.

I wanted to try and reprogram it using a gtk.Layout, but the Gtk C
documentation tells me to draw to Layout.bin_window, but I have been
unable to decode what this is in PyGtk. Some help?

In general, the GtkLayout widget is not needed for GTK 2.0 programs. GTK can handle all the double buffering, large coordinate space and flicker free scrolling internally. How big a pixmap are you creating? (X server crashes are quite serious, and should never happen).

Also, have you considered not using a backing pixmap at all, and drawing directly to the drawing area? If you do your drawing from expose_event, GTK should take care of things so that you get flicker free double buffered drawing. When the expose event handler gets fired, the event object contains the area that needs to be redrawn, so you can optimise what you redraw.

By taking advantage of GTK's facilities, you might find the problem very easy to solve. If it turns out to be too slow, then look at the optimisations.

James.

--
Email: [EMAIL PROTECTED]
WWW: http://www.daa.com.au/~james/



_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to