From 7ecce9ea239f98cf95990144435238d8541b28f2 Mon Sep 17 00:00:00 2001 From: Juan Pablo Ugarte Date: Mon, 5 Oct 2020 21:10:22 -0300 Subject: Docs: add doc about registering custom types at runtime. Closes issue #360 "No examples in documentation on using custom catalogues with gtkBuilder" --- doc/catalogintro.sgml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'doc') diff --git a/doc/catalogintro.sgml b/doc/catalogintro.sgml index 8abfce2c..13367ee7 100644 --- a/doc/catalogintro.sgml +++ b/doc/catalogintro.sgml @@ -35,6 +35,20 @@ some basic examples and describe a wealth of options that can be used to enhance UI editing and workaround exceptions. + +Keep in mind you need to take extra steps to ensure GtkBuilder can pick up your +new object types at runtime. Ussualy all you need is to link your executable +with your widget library assuming it has properly named get_type() functions. + + gtk_window_get_type +GtkHBox -> gtk_hbox_get_type +GtkUIManager -> gtk_ui_manager_get_type +GWeatherLocation -> gweather_location_get_type]]> + +If not you can always register your widgets with the type system with g_type_ensure () + + + The catalog file starts by specifying the name of the catalog and the plugin library to use, the following examples assume you have a namespace "Foo" and -- cgit v1.2.1