Need I ensure new types on vala while using .ui templates?

If the first appearance of the type in the code is in the template .ui, do I need to call GType.ensure () of a new type in the class constructor? I didn’t do this on Sdk version 46 and everything worked. On the master version without ensure, the template cannot find the type.

It’s going to have to do with how your application is compiled.

If you have a shared library or a program that has -export-dynamic and the _get_type() function is exported, then GtkBuilder can locate the symbol automatically.

Additionally, if another type that is registered has forced the type to load, then it will work.

Otherwise you’ll need to do your GType.ensure() which is generally good form from your equivalent of class_init (where we put them in C).

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.