from gi.repository import Gtk, GLib
import signal

w = Gtk.Window(default_height=150, default_width=150)
l = Gtk.Label(label="wait for it")
w.add(l)
w.show_all()

adj = Gtk.Adjustment.new(1, 0, 100, 1, 1, 1)
s = Gtk.SpinButton.new(adj, 1, 1)

def foo():
    l.destroy()
    s.show()
    w.add(s)

GLib.timeout_add(1000, foo)


def foo2():
    s.props.valign = Gtk.Align.CENTER

GLib.timeout_add(2000, foo2)

GLib.unix_signal_add(0, signal.SIGINT, Gtk.main_quit)
Gtk.main()
