This code: applicationClass.OverrideActivate(func(a *gio.Application) { exampleApp := (*exampleApplication)(unsafe.Pointer(a.GetData(dataKeyGoInstance))) var app gtk.Application a.Cast(&app) obj := gobject.NewObject(senbaragtk.MainApplicationWindowGLibType(), "application", app, ) var window senbaragtk.MainApplicationWindow obj.Cast(&window) exampleApp.window = &window var cb func(senbaragtk.MainApplicationWindow) = func(w senbaragtk.MainApplicationWindow) { fmt.Println("Test button clicked") exampleApp.window.ShowToast("Button was clicked!") exampleApp.window.SetPropertyTestButtonSensitive(false) time.AfterFunc(time.Second*3, func() { exampleApp.window.ShowToast("Button re-enabled after 3 seconds") exampleApp.window.SetPropertyTestButtonSensitive(true) }) } exampleApp.window.ConnectButtonTestClicked(&cb) exampleApp.window.Present() })
This code: vfunc_activate() { this.#window = new SenbaraGtk.MainApplicationWindow({ application: this, }); this.#window.connect("button-test-clicked", () => { console.log("Test button clicked"); this.#window.show_toast("Button was clicked!"); this.#window.test_button_sensitive = false; setTimeout(() => { this.#window.show_toast("Button re-enabled after 3 seconds"); this.#window.test_button_sensitive = true; }, 3000); }); this.#window.present(); }
New progress on the #puregotk #GObject introspection things I'm working on in #Go . It's super early, but I added preliminary support for generated getters/setters for properties. No more manual value setup & `SetProperty` calls required, just a simple `SetPropertyX` call.