Black magic 2 me



Hi all! :)
	This is total mistery for me... I've made my program, compiled it, played around with it a bit... no problem. Just the way I wanted... then, I begun writing the documentation... and I needed to take some screenshots; I switched to the MicroGUI theme and the Default GTK, as the doc guidelines say, and... with my great disappoint, it gave me two runtime errors:

Gdk-ERROR **: BadPixmap (invalid Pixmap parameter)
  serial 5241 error_code 4 request_code 128 minor_code 2
Gdk-ERROR **: BadPixmap (invalid Pixmap parameter)
  serial 5247 error_code 4 request_code 128 minor_code 2

and refused to work. The compilation was fine, but it wouldn't start... I did a little bit of code checking, and found that the error was given by this function:

/**
 * 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);
    gdk_imlib_destroy_image(tempimg);
/**/
    gtk_widget_shape_combine_mask(wid, b, 0, 0);
/**/
    gdk_imlib_free_bitmap(b);
}

it is called 24 times by my program with the same 'mask' (and 10-12 more times with other parameters). Well, it goes fine, but the *24th* time it gives those two errors. the other 35 times it works perfectly... the widget to modify *does* exist, and all is good, AFAICS... by the way, the problem seems to be produced by the gtk_widget_shape statement; if I comment it out, all works fine (of course, as one expects to without that command).

But the strange thing is another: i tried re-switching to the theme I had before (I've been having that one since I began writing the program), absolute-e GTK theme with Absolute-S Sawfish theme, and... it all worked again!! Tried to mess around something, and apparently the problem is the GTK theme: with absolute-e my program works, with anyone else I've tried (but I didn't try more than 4-5 of them), not. I've tried also to run it under KDE, and the problem was the same.

How can a program be theme-dependent? I use only pixmaps made by me; the 'mask' string is strictly formed by the same absolute path (to my own /usr/share/<myprogram>/theme/ dir) and the file name, and it exist... I've checked this. Maybe there's some sort of cache to empty? I can't understand! If I had written it with another theme installed, I would have the same problem with that? and, WHYYYYYY???????? Help me, if you can! I really don't understand!!
	Thanx,
		Mano :)
_________________________________________________________________________
Scendi in pista con Ciaoweb!
Vinci 10 skipass al giorno e uno splendido weekend a Cervinia.
Scia e vinci su http://www.ciaoweb.it/Viaggi	





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