[pygtk] gtk_image_new_from_file in pygtk?

Jorge Vargas jorge.vargas at gmail.com
Mon Nov 6 09:25:29 WST 2006


On 11/5/06, Gian Mario Tagliaretti <g.tagliaretti at gmail.com> wrote:
> 2006/11/5, Jorge Vargas <jorge.vargas at gmail.com>:
> > hi I'm following
> > http://www.gnome.org/projects/ORBit2/appletstutorial.html#AEN72
> >
> > since
> > http://www.pygtk.org/articles/applets_arturogf/index.html#AEN55
> > is a bit outdated and it's more oriented to the app in question then a
> > general howto
>
> I hope that when you will find out how things works you will update
> the howto or write a brand new better one.
>
I don't think I'm the best person to write that since I'm totally new
to gtk programming if someone is willing to review something I do and
post it I can come up with something.

> >
> > I'm trying to look for a way to translate this
> > image = gtk_image_new_from_file ("/usr/share/pixmaps/mypicture.png");
> >
> > now on both api's for the GTKImage it says different.
> >
> > http://developer.gimp.org/api/2.0/gtk/GtkImage.html
> > http://www.pygtk.org/docs/pygtk/class-gtkimage.html
> >
> > according to the pygtk api there is no equivalent of the above method
> > and I have to do something like.
> >
> >     image = gtk.Image()
> >     image.set_from_file('/usr/share/pixmaps/bug-buddy.png')
> >
> > is this the correct approach?
>
> I've sent a patch to pygtk [1] in order.to have the constructors:
>
> gtk.image_new_from_pixmap
> gtk.image_new_from_image
> gtk.image_new_from_file
> gtk.image_new_from_pixbuf
>
> [1] http://bugzilla.gnome.org/show_bug.cgi?id=371293
>
> at the moment yours seams to be the better solution.
>
so that's why I couldn't find them thanks I'll keep an eye on the patch

> cheers
> --
> Gian Mario Tagliaretti
> http://www.parafernalia.org/pygtk/
>


More information about the pygtk mailing list