Suppressing glyphsPalette updates?

Is it possible to suppress updates (i.e. the update() method) for a glyphsPalette if the palette is closed (using the little triangle)? I am working on a palette that could slow down Glyphs quite a bit if it is called frequently even if closed.

To me, it would make most sense if Glyphs simply did not call the method if the palette is closed but I’d be happy to implement this myself if the palette can find out whether it is open or closed (I tried long and hard but couldn’t find a way).

1 Like

You can try a few things.
first, there should be a user defaults like this:

defaults.boolForKey_("PanelPaneCollapsed_" + self.title)

Or, check the height of the panel view.

So, I tried out a few more things.

Since defaults is not defined I tried:

NSUserDefaults.standardUserDefaults().boolForKey_("PanelPaneCollapsed_" + self.title)

which gives me this error:

TypeError: cannot concatenate 'str' and 'objc.python_selector' objects

How can I get the title as a string?

Also:

I tried:

print self.dialog.frame()
print self.paletteView.getNSWindow().frame()

Very strange: The height does not change (for both frames) but it seems that self.dialog.frame().origin.y == 0 if the panel is not collapsed, except for the very first time update() is called, when it has an inexcplicable value, even different from the collapsed state. Is origin.y a safe way to find out whether the panel is collapsed?

Hang parentheses after the title: title()