]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/grid.cpp
Rework how widget ownership works in Container
[libs/gltk.git] / source / grid.cpp
index 6296098f511017c339058050a4a73eaba2c81de9..eb32cc91d8c4ec2f0c757d36b8f2ceb8f7d3cdea 100644 (file)
@@ -3,11 +3,9 @@
 namespace Msp {
 namespace GLtk {
 
-Grid::Grid(Layout &l, unsigned c):
+Grid::Grid(Layout &l, size_t c):
        Arrangement(l),
-       columns(c),
-       first_row(true),
-       column(0)
+       columns(c)
 { }
 
 void Grid::skip()
@@ -17,6 +15,9 @@ void Grid::skip()
 
 void Grid::next_row()
 {
+       if(row_bottom.empty())
+               throw arrangement_error("empty row not allowed");
+
        finish_row();
 }