Re: [gtkmm] problem using stipple in Gdk::GC



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.

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

-- 
Murray Cumming
murray usa net
www.murrayc.com




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