Skip to content

Commit

Permalink
glib-macros: extend Properties docs with the getter-setter docs
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmn committed Feb 17, 2025
1 parent bf86950 commit 3581e84
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion glib-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ pub fn cstr_bytes(item: TokenStream) -> TokenStream {
///
/// # Documentation
///
/// Doc comments preceding a `#[property]` attribute will be copied to the generated getter method.
/// Doc comments preceding a `#[property]` attribute will be copied to the generated getter and setter methods. You can specify different comments by the getter and setter by using `# Getter` and `# Setter` headings. The text under the header will be copied to the respective method.
///
/// ## Extension trait
/// You can choose to move the method definitions to a trait by using `#[properties(wrapper_type = super::MyType, ext_trait = MyTypePropertiesExt)]`.
Expand Down Expand Up @@ -1426,6 +1426,15 @@ pub fn cstr_bytes(item: TokenStream) -> TokenStream {
/// optional: RefCell<Option<String>>,
/// #[property(get, set)]
/// smart_pointer: Rc<RefCell<String>>,
/// /// # Getter
/// ///
/// /// Get the value of the property `extra_comments`
/// ///
/// /// # Setter
/// ///
/// /// This is the comment for the setter of the `extra_comments` field.
/// #[property(get, set)]
/// extra_comments: RefCell<bool>,
/// }
///
/// #[glib::derived_properties]
Expand Down

0 comments on commit 3581e84

Please sign in to comment.