tl;dr: Use the Python constructor normal form to set construction properties instead of the convenience C API.
The various _new constructors in the C API, including the basic _new() one, are just wrappers around g_object_new(). Constructors like type_new_with_foo() are just convenience functions for C developers to give some type safety around a call to g_object_new() and property setting; so, for instance, gtk_recent_chooser_menu_new() is just:
return g_object_new (GTK_TYPE_RECENT_CHOOSER_MENU, NULL);
and gtk_recent_chooser_menu_new_for_manager() is:
return g_object_new (GTK_TYPE_RECENT_CHOOSER_MENU, "recent-manager", manager, NULL);
i.e. a way to set the (constructor-only) "recent-manager" property.
The Python bindings do not call the C API for constructing objects; the Python constructor normal form, e.g.:
button = Gtk.Button()
is the equivalent of calling g_object_new(GTK_TYPE_BUTTON, NULL). The constructor normal form accepts arguments, in the form of a dictionary of property names and values:
button = Gtk.Button(label='Hello, world')
This is the equivalent of calling gtk_button_new_with_label() in C. The Python bindings layer will provide all the necessary type safety at run time.
It's usually recommended to use this approach, and not calling the C API because:
- it's more Pythonic, as it follows the conventions of the language
- it's more flexible, as it lets you set more properties without requiring additional C API