Refresh glyphsPalette view?

How can I refresh a plugin view on the palette after resize?

Very similar to how you set it up in the first place. remove all buttons you have made earlier and add new ones. I’ll need to check what is the best way to resize the panel view.

palleteView.group.resize() works in settings() (before it was drawn, I suppose) but it doesn’t work from a button callback
Is there a resize method directly for VNSView?

Upd:
VNSView.setFrameSize_() works only in settins() too

I had a look at this, this morning. It might work if you use autolayout. Otherwise the system (or vanilla) will add automatic constrains and those fix the size of the view.

Sorry, but I didn’t get how to use autolayot. Can you show some pieces of code?

It works for predefined buttons, but I can’t make it for dynamic. How can I modify already added vertical rule?
I tried adding buttons with Frame and Auto layouts, adding new rules, but all this did not affect the window size.

It works the same for dynamic buttons. You just have to read the constrains, too.

I’ve tried this and it works from Glyphs macro:

class Test:
    def __init__(self):
        self.w = vanilla.Window((200, 200), minSize=(100, 100))
        self.w.group = vanilla.Group("auto")
        self.w.group.button1 = vanilla.Button("auto", "b1")
        self.w.addAutoPosSizeRules(
            [
                "V:|[group]|",
                "H:|[group]|",
            ],
            {},
        )
        g_view = self.w.group.getNSView()
        b_view = self.w.group.button1.getNSButton()
        g_view.addConstraints_(
            [
                b_view.topAnchor().constraintEqualToAnchor_constant_(
                    g_view.topAnchor(), 0
                ),
                b_view.leftAnchor().constraintEqualToAnchor_constant_(
                    g_view.leftAnchor(), 0
                ),
                b_view.widthAnchor().constraintEqualToConstant_(100),
            ]
        )
        self.w.open()

but if I try to do the same as plugin, I get a zero height window

ps. don’t get how to paste code

I put the code into your post. (you do it bey adding three grave characters before and after the code block).
I’ll try to put together a test plugin.