Well, I can pause, the problem is that all my "pauses" are accumulating instead of being sequentially done. I tried many clocks stuff, sleep,.. with each time the same result. Am I missing something here? I just want to do this to help me program with a visual feedback, it won't stay in the code, so anything, even dirty, is welcome!
void Dockable::resize_cells() {
for (int i = 0; i < cells.size(); i++) {
for (int j = 0; j < cells[i].size(); j++) {
if (cells[i][j] != layout) {
if (cells[i][j]->is.docked) {
int found_col = 0;
bool found = false;
int pos = 0;
for (int k = 0; k < cells.size(); k++) {
int col = 0;
for (int l = 0; l < cells[k].size(); l++) {
if (!found) {
if (cells[i][j] == cells[k][l]) {
found = true;
pos = col;
}
}
if (!(l - 1 < 0) &&
cells[k][l] != cells[k][l - 1]) {
col++;
}
else {
col++;
}
if (found) {
if (col > found_col) {
found_col = col;
}
}
}
}
cells[i][j]->x_size(layout->x_size() / found_col);
cells[i][j]->x((layout->x_size() / found_col) * pos);
cells[i][j]->refresh_shape_apply();
wait();
}
}
}
}
}
void Dockable::wait()
{
clock_t counter;
clock_t target;
counter = clock();
target = clock() + 100;
while (counter < target) {
counter = clock();
std::cout << counter << std::endl;
}
}
refresh_shape_apply, applies the transformations, since it's executed before the wait, I had hopes that it would work.