UI-update
Troels Sørensen <trold-/cMCkHlkxH8bN9Upbcd4uVpr/1R2p/[email protected]>
| Newsgroups | gmane.comp.graphics.ipe.general |
|---|---|
| Message-ID | <CAJ9COepxdg7QhXgivDgofbuKL6MGKRdXeRPx_zvk4sE7xEqv1A@mail.gmail.com> |
I am currently writing a few ipelets in lua to manipulate layers and view,
but I have encountered the following problem: after removing some views and
layers, I cannot get the UI to update sensibly. The UI does not update
until the user attempts to change view or active layer, and if the
requested view is greater than countViews(), Ipe will crash. Is there a
way to set the current view and update the layers list?
AppUi(model):update() is not accessible...
/trold
function removeDuplicateViews(model)
page = model:page()
i = page:countViews() - 1
while (i > 0) do
found = false
for j, layer in pairs(page:layers()) do
if (page:visible(i, layer) ~= page:visible(i + 1, layer)) then
found = true;
end
end
if not found then
model:page():removeView(i+1)
end
i = i - 1;
end
end
_______________________________________________
Ipe-discuss mailing list
Ipe-discuss-rGrgPyRx506NN8uzcEdRPYRWq/[email protected]
http://lists.science.uu.nl/mailman/listinfo/ipe-discuss