Backing Pixmap woes with frames ... the saga continues





Hi,

I sent this message something like 2 weeks ago and Andreas Tille
remarked that I should use
     gtk_container_add (GTK_CONTAINER(d_previewFrame), d_pixmap)
which it turns out the Gtk-- hierarachy (frame->bin->container) is resolved to
anyways ...

I've since dug some more through my code and everything seems to work
OK, but GDK throws up on my depth of -1. What I don't understand is this:

I always allocate the pixmap with the code shown below (depth == -1). Why would
this typically work (on my main drawing window for example) but fail when trying
to add this to a dialog. Is there anything about the use of Pixmaps that I'm
missing
here? I'm obviously confused ...

Thanks
--> R
---------------------- Forwarded by Robert Gasch/PeopleSoft on 05/03/99 10:38 AM
---------------------------


Robert Gasch
04/24/99 12:39 PM

To:   gtk-list@redhat.com
cc:
Subject:  Backing Pixmap woes with frames

Hi,

I'm trying to add drawing area with a backing pixmap
to a window I'm building, but am running into trouble:

> Gdk-CRITICAL **: file gdkpixmap.c: line 62 (gdk_pixmap_new):
> assertion `(window != NULL) || (depth != -1)' failed.
> Gdk-CRITICAL **: file gdkdraw.c: line 89 (gdk_draw_rectangle):
> assertion `drawable != NULL' failed.

The backing pixmap is built as follows:
     d_pixmap = gdk_pixmap_new(get_window(), x, y, -1);

I've used this code in a few other modules before without
any problems. Now though I try to add the drawing area
to a frame, and it seems that the gdk_pixmap_new() is failing,
specifically get_window() seems to return NULL.

Here's a quick rundown on what I'm doing:
     d_previewFrame = new Gtk_Frame ();
     d_vBoxPreview.pack_start (*d_previewFrame, FALSE, FALSE, 0);
     d_previewGroupFrame = new Gtk_Frame ("Preview");
     d_previewGroupFrame->add (d_vBoxPreview);

     // GuiBufferedDrawingArea allocats the DA and backing pixmap
     d_drawArea = new GuiBufferedDrawingArea ();
     d_previewFrame->add (*d_drawArea);

So far so good, but when I try to do a
     d_drawArea.setUsize (sx, sy);
(which in fact only destroys to old pixmap, creates a new one (see
statement above) and resizes the drawing area), I get the 2 Gdk-CRITICAL
errors above.

Is there anything special that I must know/remember when using frames
instead of adding a drawing area to a vBox directly?

Thanks
-> Robert







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