RE: (gtk_pixmap_new): assertion `val != NULL' failed



Hi Helmethead,

>Have you ever tried doing this when you were learning C:
[nice code]

This is true.

>That's the same reason why ronald's proposal won't work. Mine will tho
>unless I've made some silly screw up too :)
>By the way I didn't make much sense when I was talking about the cause >of
the segfault, I was confusing myself. Are you sure it was on the
>line you said it was? Did you actually try out the g_prints to see if
>they print?

But this is not. Because I work with pointers, so the data should be saved.
Right? Or am I really missing a big big big big point here?

I do see your point here - but as far as I see my code did work with
pointers - so the data should be kept in place.

---
#include "image.xpm"
void create_pixmap(GtkWidget *w) {
  GdkPixmap *pixmap;
  GdkBitmap *mask;
  pixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL,
     gtk_widget_get_default_colormap(),
     &mask, NULL, (gchar **)image_xpm);
  w = gtk_pixmap_new (pixmap, mask);
}
void test() {
  GtkWidget *w = NULL;
  create_pixmap(w);
  if (w == NULL) g_print("I am stupid\n");
  else g_print("I am not that stupid\n");
}
---

Should return "I am not that stupid", right? (I don't have a xwindows
computer on my hands here so I can't test it - grom).
w is a pointer in itself, so although I'm not making pointers to this
pointer, we're still working with pointers so your point in the simple-C
example is a good point but does not apply here. Right?

But I might have missed your point completely :-).

Regards,

Ronald





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