[Ipe-discuss] UI-update

Troels Sørensen trold at dcs.warwick.ac.uk
Fri Nov 25 15:54:55 CET 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/ipe-discuss/attachments/20111125/40c82dc2/attachment.html 


More information about the Ipe-discuss mailing list