Re: Some problems with gtk and imlib that you might be able to help me with.



Kent,

gtk_pixmap_new() returns "GtkWidget *", ie a
widget for holding a pixmap, but you
are assigning the ret val to a "GtkPixmap *".

- Dermot

Date: Thu, 11 Jan 2001 19:30:05 +0100 (CET)
From: Kent Nyberg <blurkis bonbon net>
To: gtk-app-devel-list gnome org
Subject: Some problems with gtk and imlib that you might be able to help me
with.

I am trying to learn to use imlib and gtk, and have run in to some
problems.

This is probably more likely an imlib question, but you might have the
answere, so i don't feel like looking up where to ask questions about
imlib.
I have done it like the documents says, so i cant find any more help.. :(


This is the problem in the source..  i have taken out just the things that
matter.

--

GdkImlibImage         *main_image;
GdkPixmap             *main_picture;
GdkBitmap             *main_picture_mask;
GtkPixmap             *logo;



main_image=gdk_imlib_load_image("./risk.jpg");

gdk_imlib_render(main_image,640,480);
main_picture      = gdk_imlib_move_image(main_image);
main_picture_mask = gdk_imlib_move_mask(main_image);

logo = gtk_pixmap_new(main_picture, main_picture_mask);

--

When i compile my source i get the following warning from gcc:
gcc  -O2  `gtk-config --cflags`  src/main.c -o risk `gtk-config --libs`
-lgdk_imlib
In file included from src/main.c:16:
src/gui.h: In function `create_main_window_gui':
src/gui.h:67: warning: assignment from incompatible pointer type

---
The line 67, is :
logo = gtk_pixmap_new(main_picture, main_picture_mask);
(which is written above.. )


The thing is that gtk_pixmap_new is defined as:

GtkWidget* gtk_pixmap_new        (GdkPixmap  *pixmap,
                                  GdkBitmap  *mask);

And that is excacty what i have done in the source.. atleast i think that
is what i have done :)

Sorry if you cant understand the source, but i thought that you might get
angry if i attatch the whole source :)


/Kent.









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