diff options
author | Philip Chimento <philip.chimento@gmail.com> | 2020-08-02 21:41:49 -0700 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2020-08-02 21:41:49 -0700 |
commit | 30a7b2076f1a803b3424151503c7005262d532f2 (patch) | |
tree | e90104a09840fbb5dbcaad16aafe1c7a48bbdf86 | |
parent | 13642229b75d529c7f0c946a8d3548297104a5f8 (diff) | |
download | gobject-introspection-30a7b2076f1a803b3424151503c7005262d532f2.tar.gz |
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.
-rw-r--r-- | docs/website/writingbindableapis.rst | 9 |
1 files changed, 9 insertions, 0 deletions
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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |