Skip to content
  • Niels De Graef's avatar
    GIR: Try to return more specific GtkWidget subclass · df28349c
    Niels De Graef authored
    In GTK, a common scheme is to let a function creating a specific widget
    to return a `GtkWidget *`, rather than the specific subtype, since you
    often need to call API of GtkWidget, avoiding some useless casts.
    
    For bindings however (and especially bindings to compiled languages),
    this is a bit annoying, as you have to explicitly change the type of the
    return value (downcast), which is not trivial (or at least desirable) in
    each language.
    
    Luckily, we can use `(type ...)` annotation for this use case, leaving
    the C API unchanged, while improving the experience for bindings.
    df28349c