[gobject-introspection: 1/2] website: Add section about property/method name conflicts
- From: Mathieu Duponchelle <mathieudu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection: 1/2] website: Add section about property/method name conflicts
- Date: Sat, 8 Aug 2020 14:48:14 +0000 (UTC)
commit 30a7b2076f1a803b3424151503c7005262d532f2
Author: Philip Chimento <philip chimento gmail com>
Date: Sun Aug 2 21:41:49 2020 -0700
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(+)
---
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]