Re: [gnomemm] CanvasImage
- From: Murray Cumming <murrayc usa net>
- To: "Koecher Rainer ETR.ETB2" <Rainer Koecher ElinEbgTraction at>
- Cc: gnomemm-list <gnomemm-list gnome org>
- Subject: Re: [gnomemm] CanvasImage
- Date: 11 Sep 2002 08:58:04 +0100
Personally, I'm only likely to investigate this if you are using
gnomemm2. Sorry.
On Mon, 2002-09-09 at 14:36, Koecher Rainer ETR.ETB2 wrote:
> hello everybody,
>
> does anyone know how to display an Image in a Gnome Canvas?
> I tried it as follows:
>
> I defined the class Cimage, instanced a Object of it and inserted it in
> a GTK::Hbox with pack_start(...). The result was the following Message
> at runtime:
>
> Gtk-CRITICAL **: file gtkobject.c: line 939 (gtk_object_add_arg_type):
> assertion `arg_type > GTK_TYPE_NONE' failed.
>
> GnomeUI-WARNING **: gnome_canvas_item_set(): could not find argument
> "image" in the `Gnome__CanvasImage' class ancestry
>
>
> /* CODE */
>
> #include <gnome--/canvas.h>
> #include <gnome--/canvas-image.h>
> #include <gnome--/imlib.h>
> #include <string>
> class CImage: public Gnome::Canvas {
> public:
> CImage(string filename);
> ~CImage();
> protected:
>
> private:
> Gnome::CanvasImage *Image;
> Gdk_Imlib::Image Img;
> string FileName;
> };
>
> CImage::CImage(string filename):Gnome::Canvas()//, Img(filename)
> {
> FileName = filename;
> Img.load(FileName);
> Image = new Gnome::CanvasImage(*root(), 1.0, 5.0, Img);
> // Image->set_anchor(GTK_ANCHOR_NW);
> // Image->set_image(Img);
> }
>
> CImage::~CImage()
> {
> delete Image;
> }
>
>
--
Murray Cumming
murrayc usa net
www.murrayc.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]