Implement abstract classes differently
Closed this issue · 2 comments
diamondburned commented
Right now, lots of classes have invalid method collisions when they don't have
to be. This is because abstract classes are being generated as if they're
interfaces, which isn't quite true.
A better way to generate abstract classes would be:
package gtk // gtk/v4
type Widgetter interface {
glib.Objector
widget() // mark
}
diamondburned commented
Note that by doing this, abstract class getters will have to be casted to
something, which is very inconvenient.
diamondburned commented
Oh no!
panic: object of type GtkFlowBoxChild is not gtk.Widgetter
goroutine 1 [running]:
github.com/diamondburned/gotk4/pkg/gtk/v3.(*Container).Children.func2(0x879ec0)
/home/diamond/.go/pkg/mod/github.com/diamondburned/gotk4/pkg@v0.0.0-20211019185411-d2e12b4d9da4/gtk/v3/gtkcontainer.go:604 +0x17f