I’m writing my actual project in Vala using Adw.SpinnerPaintable, but I also get this problem when testing with Python using just Adw.Spinner.
Whenever I spawn an Adw.Spinner or set Adw.StatusPage:paintable to an Adw.SpinnerPaintable, the spinner simply remains static and never spins. Adw.SpinnerPaintable’s docs suggest the issue might be that the containing widget is not yet mapped, but this continues to happen on Adw.Spinner - which should have its own frame-clock - and despite the fact I’m recreating the spinner after presenting the app window.
I get this problem with this code:
import gi
gi.require_version("Adw", "1")
gi.require_version("Gtk", "4.0")
from gi.repository import Adw, Gtk
class App(Adw.Application):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.connect("activate", self.activate)
def activate(self, app):
win = Adw.ApplicationWindow(application=app)
button = Gtk.Button()
button.connect("clicked", self.click)
self.box = Gtk.Box()
self.box.append(button)
win.set_content(self.box)
win.present()
def click(self, _):
spinner = Adw.Spinner(width_request=48, height_request=48)
spinner.set_halign(Gtk.Align.CENTER)
spinner.set_valign(Gtk.Align.CENTER)
self.box.append(spinner)
app = App(application_id="com.example.app")
app.run()