[gtkmm/gtkmm-3-24] Gtk::Grid: Add default values in attach()



commit 9ea8f1046aa51da8d45897ce29ee0a558a362235
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Mon Aug 20 09:59:42 2018 +0200

    Gtk::Grid: Add default values in attach()
    
    Add default value = 1 for the width and height parameters in attach() and
    attach_next_to(). Fixes #20

 gtk/src/grid.hg | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gtk/src/grid.hg b/gtk/src/grid.hg
index efb8c2dd..1e5e015a 100644
--- a/gtk/src/grid.hg
+++ b/gtk/src/grid.hg
@@ -33,9 +33,10 @@ namespace Gtk
  *
  * Children are added using attach(). They can span multiple
  * rows or columns. It is also possible to add a child next to an
- * existing child, using attach_next_to().
+ * existing child, using attach_next_to(). The behaviour of
+ * %Grid when several children occupy the same grid cell is undefined.
  *
- * Grid can be used like a Box by just using Gtk::Container::add(),
+ * %Grid can be used like a Box by just using Gtk::Container::add(),
  * which will place children next to each other in the direction determined
  * by the orientation property.
  *
@@ -56,7 +57,7 @@ public:
   //TODO: Add a Grid(Orientation orientation = ORIENTATION_HORIZONTAL) constructor to match the Paned and 
Box ones?
   //Probably not, because a vertical GtkGrid is not very useful. murrayc.
 
-  _WRAP_METHOD(void attach(Widget& child, int left, int top, int width, int height), gtk_grid_attach)
+  _WRAP_METHOD(void attach(Widget& child, int left, int top, int width = 1, int height = 1), gtk_grid_attach)
 
   /** Adds a widget to the grid.
    *
@@ -75,7 +76,8 @@ public:
    * @param width The number of columns that @a child will span.
    * @param height The number of rows that @a child will span.
    */
-  _WRAP_METHOD(void attach_next_to(Widget& child, Widget& sibling{?}, PositionType side, int width, int 
height), gtk_grid_attach_next_to)
+  _WRAP_METHOD(void attach_next_to(Widget& child, Widget& sibling{?}, PositionType side,
+    int width = 1, int height = 1), gtk_grid_attach_next_to)
 
   _WRAP_METHOD(Widget* get_child_at(int left, int top), gtk_grid_get_child_at)
   _WRAP_METHOD(const Widget* get_child_at(int left, int top) const, gtk_grid_get_child_at)


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