Search code examples
gtkpygtk

How can I insert an image on a Gtk.Label. Is this possible? Or do I need to find another solution?


I have a Database with this fields: Firstname, Lastname, picture. I have a gtk.Label named infoLabel.

I would like to update the label a way like this:

Label.set_markup("<img src='pix/1.png'>\nName" + Firstname + " " + Lastname)

But it isn't works, because img isn't allowed in Pango markup. How I can do this?


Solution

  • I wouldn't expect to be able to have an image in label, no.

    But you should be able to replace any label with a container holding a GtkImage and the label, and solve it that way.

    Of course you will have to have the image in local memory, first.