RE: gtk.Image



My suggestion is first you use self.rImage.get_storage_type() to find
the image type because "The get_image() method returns a tuple
containing the gtk.gdk.Image and mask being displayed by the gtk.Image.
One or both of the gtk.gdk.Image and mask may be None. If the storage
type of the image is not either of gtk.IMAGE_EMPTY or gtk.IMAGE_IMAGE
the ValueError exception will be raised."
 The result I try with set_from_file() is gtk.IMAGE_PIXBUF.
You can use self.rImage.get_pixbuf() to get a gtk.gdk.PixBuf. But now I
don't know how to get the file name.

Thanks!

Yanan


-----Original Message-----
From: gtk-list-bounces gnome org [mailto:gtk-list-bounces gnome org] On
Behalf Of brad smith
Sent: Tuesday, December 25, 2007 1:57 PM
To: gtk-list gnome org
Subject: gtk.Image

Hello everyone,

I am using gtk.Image() and filling it with set_from_file with a random
image in a directory. I am trying to use gtk.get_image() to get the
name of the image currently being displayed but I get:
gImage = self.rImage.get_image()
ValueError: image should be a GdkImage or empty

There is a image being displayed when I try to get image name.
Thanks for your time,
Brad
_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list


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