Re: Started adding GObject signals to gnome-class



On Wed, 2017-08-23 at 00:49 +0100, Alberto Ruiz wrote:
As per how to map G_TYPES, you should have a look at
https://github.com/gtk-rs/glib/blob/master/src/types.rs as most of
the
work is done there. Specifically to the two last impls of the file.

Oooh, perfect, thank you.  Niko suggested something quite similar
today; having a 

trait HasGType {
    fn get_type() -> GType
}

and implementing it for all i32/bool/etc.  This is pretty much what the
StaticType trait does in that file.  I'll use it!

I do foresee some clashing between the work we're doing with
gobject_gen and gtk-rs, eventually we'll need a roadmap to bring the
two things together and being able to subclass from existing C
GObjects and classes already bound by gtk-rs (say,
Gtk.Application...).

gnome-class lets you derive from C GObjects.

I *think* gtk-rs lets you create a wrapped/bound gobject if you just
have a pointer to it, correct?  If so, gnome-class lets you access your
parent instance or parent class, and get a pointer to it... could one
pass that pointer to gtk-rs and get a binding for your parent?

Am I thinking that you want to do

gobject_gen! {
    class MyWidget: GtkWidget {
        ... derive it ...
    }
}

and in your implementation of MyWidget, actually use gtk-rs's binding
for GtkWidget instead of calling gtk functions by hand?

  Federico


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]