Re: [gtkmm] problem using stipple in Gdk::GC
- From: Daniel Elstner <daniel elstner gmx net>
- To: murrayc usa net
- Cc: Eric Newman <enewman smfs9 ma atitech com>, gtkmm-list <gtkmm-list gnome org>
- Subject: Re: [gtkmm] problem using stipple in Gdk::GC
- Date: 11 Nov 2002 23:33:34 +0100
Am Mon, 2002-11-11 um 23.08 schrieb Murray Cumming:
> On Mon, 2002-11-11 at 22:02, Eric Newman wrote:
> > I'm trying to use a stipple pattern in a GC and it's giving me X Window System Error. Here's a code snippet:
> >
> > Glib::RefPtr<Gdk::Pixmap> m_stipple =
> > Gdk::Pixmap::create_from_xpm (get_window(), m_trans_color, "stipple.xpm");
> > myGC->set_stipple(m_stipple);
> > m_refPixmap->draw_rectangle ( myGC,
> > true,
> > 0, 0,
> > 10, 10);
> >
> > If I comment out the set_stipple line, I get no error. If I try to use the stipple, I get:
> > The program 'iqcdb2.1' received an X Window System error.
Maybe the GC is invalid?
If you can't find anything peculiar in your code you could try
translating it to plain C using the Gdk types/functions. If the problem
disappears it's a gtkmm bug, otherwise you should ask on gtk-list or
report a GTK+ bug.
> Have you confirmed that the create_from_xpm worked? Maybe it didn't find
> the file. You can check like so:
>
> if(m_stipple)
> {
> myGC->set_stipple(m_stipple);
> }
>
> But I would actually expect it to throw the exception instead:
> http://www.gtkmm.org/gtkmm2/docs/reference/html/classGdk_1_1Pixbuf.html#d4
It's a Pixmap -- not a Pixbuf. GdkPixmap unfortunately doesn't report
errors when loading the file failed.
--Daniel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]