Re: Bug 50372: Setting stipple to NULL = X error



Did a bit of experimentation.

>> If NULL is not allowed, it should g_return_if_fail (GDK_IS_BITMAP
>> (stipple)).
>> 
>> If NULL is allowed, it should mean "unset the stipple," that is, I
>> think you set it to None with the Xlib API.
>
> But the whole point is, you can't set the stipple to None with the
> Xlib API. You have to change the fill mode (gdk_gc_set_fill)
> to be something other than GDK_STIPPLED. But I think changing
> the fill mode would be wrong in this function.

Actually, you can set the stipple to NULL, using the XCopyGC function.
IE., 

  {
    GC gc;
    GC temp;

    // Copy everything except the stipple
    XCopyGC(display, gc, ~GCStipple, temp);

    // Copy everything back.
    XCopyGC(display, temp, ~0, gc);
  }

Testing seems to indicate that this works as expected.
X doesn't complain about the fact that the fill mode is
set to FillStipple, with a NULL stipple.

If this is acceptable, then I shall code it up and post the new 
patch to bugzilla.


Jamie.

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/




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