Gtk Picture not updating (original) (raw)

November 19, 2024, 10:14am 1

I’m writing a Python Application in GTK4 + Adwaita with Flatpak and Gnome runtime version 47.
The relevant code is here

The code is supposed to change ~3 images at ~10FPS to create an animation.
The problem is that the image does not update. When I open the inspector, I can clearly see the attribute changing, also, when I open it the image actually change for some seconds.
If I switch to GtkImage, everything works, however the image is not upscaled to adapt to its container.

How can I fix this? I remember it working on Gnome Platform 46

rafaelmardojai (Rafael Mardojai CM) November 19, 2024, 11:26pm 2

Not a direct answer to your question, but you probably want to implement a custom Gdk.Paintable and do the animation there.

For reference here you can find a simple Gdk.Paintable in Python for a GIF image:

But in your case I think you can avoid GdkPixbuf and create a Gdk.Texture for each frame.

jspast (João Pastorello) November 22, 2024, 10:25pm 3

So it seems this has already been fixed but the Flatpak Runtime has not been updated with it. I am not sure where to report this

system (system) Closed December 22, 2024, 10:26pm 4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.