[gtkmm/gtkmm-3-22] CellLayout: Improve docs of get_first_cell() funcs



commit c2400243afd7acdba3c368ea5c9fa410edcd1e14
Author: Daniel Boles <dboles src gmail com>
Date:   Mon May 8 11:10:41 2017 +0100

    CellLayout: Improve docs of get_first_cell() funcs
    
    They included the line “This assumes that the CellLayout contains only
    one CellRenderer.” But that doesn’t matter: these methods always return
    the first cell, without caring whether there are any others, and thus
    users can call them without caring too. So, that comment had no purpose.
    
    Also, these are ‘safe’ to call for Layouts containing no cells, in the
    sense that they will return nullptr, so we might as well clarify that.

 gtk/src/celllayout.hg |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/src/celllayout.hg b/gtk/src/celllayout.hg
index a65fbf2..ad5670c 100644
--- a/gtk/src/celllayout.hg
+++ b/gtk/src/celllayout.hg
@@ -60,15 +60,15 @@ public:
   _WRAP_METHOD(std::vector<CellRenderer*> get_cells(), gtk_cell_layout_get_cells)
   _WRAP_METHOD(std::vector<const CellRenderer*> get_cells() const, gtk_cell_layout_get_cells)
 
-  /** Gets the CellRenderer for the column.
+  /** Gets the CellRenderer for the first column if any has been added, or
+    * nullptr otherwise.
     * You should dynamic_cast<> to the expected derived CellRenderer type.
-    * This assumes that the CellLayout contains only one CellRenderer.
     */
   CellRenderer* get_first_cell();
 
-  /** Gets the CellRenderer for the column.
+  /** Gets the CellRenderer for the first column if any has been added, or
+    * nullptr otherwise.
     * You should dynamic_cast<> to the expected derived CellRenderer type.
-    * This assumes that the CellLayout contains only one CellRenderer.
     */
   const CellRenderer* get_first_cell() const;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]