Gtk::BuilderError Invalid object type GtkSourceView

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

 



Hello,

in the last months I was working on GTK3 bindings for the Nim
programming language (http://nim-lang.org/). Now that they are nearly
complete (https://github.com/StefanSalewski?tab=repositories) I tried to
make some example code. One is the gtksourceview test-completion.c
example, currently from gtk 3.12. Works fine, with one difference
between C original and my Nim one: Without any modifications I get an
error message about "Invalid object type GtkSourceView" from Nim
equivalent of gtk_builder_add_from_file(builder, "test-completion.ui",
&error). I can easily fix that by putting a dummy allocation like "var
h1 = view_new()" in front of gtk_builder_add_from_file() call. I think
something like "gtk_source_view_get_type()" may work also. I think that
will register the gtk_source_view gobject, and then builder can use it.
People using GTKmm or Python reports from similar problems, see
http://comments.gmane.org/gmane.comp.gnome.devtools/1390 or
http://stackoverflow.com/questions/10524196/load-gui-from-a-glade-with-gtksourceview-in-pygobject. But it seems that the examples written in C can call gtk_builder_add_from_file() without any preparation. Why? Is there a invisible init operation involved? I think such an init which registers new GObject types like GtkSourceView and related types is necessary when builder is used. But GtkSourceView library has no init function (gtk3 has one, and of course I call it, but I think it can and will not init gtksourceview lib.) I know there is another mailing list closer related to gtksourceview available, but there seems to be no activity for months. And this is not really a gtksourceview question, but more about general builder and unknown gobject types.


_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list




[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux