From 30a7b2076f1a803b3424151503c7005262d532f2 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Sun, 2 Aug 2020 21:41:49 -0700 Subject: website: Add section about property/method name conflicts This is a trap that C APIs can fall into, so it should be mentioned on the "Writing Bindable APIs" page. --- docs/website/writingbindableapis.rst | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'docs') diff --git a/docs/website/writingbindableapis.rst b/docs/website/writingbindableapis.rst index 9ab11b47..70d3bbc7 100644 --- a/docs/website/writingbindableapis.rst +++ b/docs/website/writingbindableapis.rst @@ -141,6 +141,15 @@ Error domain quarks should always be named in the form GQuark foo_bar_errors_quark(); +Don't have properties and methods with the same name +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Some bindings for dynamic languages expose GObject properties and methods in the +same way, as properties on an object instance. So don't make a GObject property +with the same name as a method, e.g. a property named ``add-feature`` on a class +named ``SoupSession`` which also has a method ``soup_session_add_feature()``. + + Custom code in constructors ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.1