[Python-es] Añadir imagenes propias en un treeview
Jose Sanchez
jose.sanchez86 en hotmail.es
Dom Ene 8 23:00:28 CET 2012
No me ha funcionado pero no pasa nada.
Al final no necesito hacerlo con un treeview
Gracias por las molestias
> Date: Sun, 8 Jan 2012 18:50:32 +0000
> From: santiago.danielfrancis en gmail.com
> To: python-es en python.org
> Subject: Re: [Python-es] Añadir imagenes propias en un treeview
>
> Una opción es esta:
>
> self.liststore = gtk.ListStore(str, gtk.gdk.Pixbuf, str, 'gboolean')
> abrir = gtk.gdk.pixbuf_new_from_file_at_size("./abrir.png", 30, 30)
> self.liststore.append(['Open fg ', abrir, 'Open a File', True])
>
> El 08/01/12, Jose Sanchez <jose.sanchez86 en hotmail.es> escribió:
> >
> > Hola:
> >
> > Me gustaria saber como cambiar las imagenes que salen del propio SO a unas
> > propias echas por mi.
> >
> > Esto es parte del codigo de un ejemplo que he encontrado en el que muestra
> > imagenes pero no se como ponerlo para que muestre unas hechas por mi:
> >
> > # create a liststore with one string column to use as the model
> > self.liststore = gtk.ListStore(str, str, str, 'gboolean')
> >
> > # create the TreeView using liststore
> > self.treeview = gtk.TreeView(self.liststore)
> >
> > # create the TreeViewColumns to display the data
> > self.tvcolumn = gtk.TreeViewColumn('Pixbuf and Text')
> >
> > # add a row with text and a stock item - color strings for
> > # the background
> > self.liststore.append(['Open fg ', gtk.STOCK_OPEN, 'Open a File',
> > True])
> > self.liststore.append(['Newfg fg', gtk.STOCK_NEW, 'New File', True])
> > self.liststore.append(['Print fgfg', gtk.STOCK_PRINT, 'Print File',
> > False])
> >
> > ¿Que debo poner en gtk.STOCK_OPEN para que salga una imagen propia ?
> >
>
>
> --
> _____ _ _ _______ _
> (____ \ (_) | | (_______) (_)
> _ \ \ ____ ____ _ ____| | _____ ____ ____ ____ ____ _ ___
> | | | / _ | _ \| |/ _ ) | | ___) ___) _ | _ \ / ___) |/___)
> | |__/ ( ( | | | | | ( (/ /| | | | | | ( ( | | | | ( (___| |___ |
> |_____/ \_||_|_| |_|_|\____)_| |_| |_| \_||_|_| |_|\____)_(___/
> _______________________________________________
> Python-es mailing list
> Python-es en python.org
> http://mail.python.org/mailman/listinfo/python-es
> FAQ: http://python-es-faq.wikidot.com/
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://mail.python.org/pipermail/python-es/attachments/20120108/09fa2787/attachment.html>
Más información sobre la lista de distribución Python-es