Re: Black magic 2 me



On Fri, Feb 09, 2001 at 02:07:34PM +0100, manomano ciaoweb it wrote:
> /**
>  * shape
>  * @wid: the widget to `cut'
>  * @mask: the name of the file containing the mask
>  * 
>  * Shapes a widget
>  **/
> void shape(GtkWidget * wid, gchar * mask)
> {
>     GdkImlibImage *tempimg;
>     GdkBitmap *b;
> 
>     tempimg = gdk_imlib_load_image(mask);
>     gdk_imlib_render(tempimg, base, base);
>     b = gdk_imlib_move_mask(tempimg);

DO NOT use _move_ functions, use _copy_.  They are not all that much slower
and they don't crap out imlib.  _move_ just gives you the xbitmap directly,
but imlib keeps some (not all) references to it afaik, the only way not to
crash is to leak it later.

BTW, why not use gdk-pixbuf for this?

George

-- 
George <jirka 5z com>
   In the fight between you and the world, back the world.
                       -- Franz Kafka




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