[9805] in The GTK GIMP ToolKit mailing list archive
[gtk-list] Re: GtkDrawingArea question
daemon@ATHENA.MIT.EDU (Conrad Steenberg)
Tue Nov 3 13:59:29 1998
Date: Tue, 3 Nov 1998 10:57:22 -0500 (EST)
From: Conrad Steenberg <conrad@srl.caltech.edu>
To: "Sergei O. Naoumov" <serge@physics.unc.edu>
cc: gtk-list@redhat.com
In-Reply-To: <199811031817.NAA14547@avarice.astro.unc.edu>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com
Hi Sergei
I have the following piece of code that works for me:
(You need a #include "gdkprivate.h" somewhere in the file. Also it draws
on a pixmap, which may not be what you want. If you want it to draw
directly on your drawing area, use your drawing area widget in the calls
to PARAMPL, instead of the pixmap.)
pixmap = gdk_pixmap_new(widget->window,
gwidth,
gheight,
-1);
sprintf(geometry,"%dx%d",gwidth,
gheight);
parampl ("XDRAWABLE_DISPLAY", ((GdkWindowPrivate*)pixmap)->xdisplay);
parampl ("XDRAWABLE_DRAWABLE1",&(((GdkWindowPrivate*)pixmap)->xwindow));
parampl ("XDRAWABLE_DRAWABLE2",&(((GdkWindowPrivate*)pixmap)->xwindow));
parampl ("BITMAPSIZE", geometry);
pl_handle = newpl ("Xdrawable", NULL, NULL, stderr);
selectpl (pl_handle);
openpl ();
fspace (0.0, 0.0, width/height, 1.0);
erase (); /* erase Plotter's graphics display, aka draw it*/
Conrad
*-----------------------------------------*
| Conrad Steenberg |
| Caltech, Mail Code 220-47 |
| Pasadena, CA, 91125 |
| e-mail: conrad@srl.caltech.edu |
| Tel: (626) 395-2964 Fax: (626) 449-8676 |
*-----------------------------------------*
--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null