2.5b (1125): objc.error: GlyphPreviewView is overriding existing Objective-C class

With Glyphs 2.5b (1125) beta, I’m seeing the following message in the Macro Panel. I don’t recall seeing it in the previous (1123) release. fyi.

Traceback (most recent call last):
  File "<string>", line 8, in <module>
  File "GlyphsApp/objectsGS.py", line 1308, in <module>
objc.error: GlyphPreviewView is overriding existing Objective-C class

I saw that, too. I have a look.

Fixed it.

Still seeing the overriding existing Objective-C class message appear in Glyphs 2.5b (1026). Same as the earlier posted text. fyi.

OK: I forgot this one. Now it should be fixed.

I also have the same error in 2.5.1 1133, while I’m testing the sample code in ObjectGS.py.

Symptom 1
It occurred when I run this sample code in macro panel.
In previous version(2.5b), it occurred when I run the code which is similar to below twice. At first run, it’s Okay, but the second run showed the error message. Then I closed and re-ran Glyphs and tested again.
But some time later, it shows an error message every time.

from vanilla import *
from objectsGS import GlyphPreview
class GlyphPreviewDemo(object):
def __init__(self):
    self.title = "Glyph Preview"
    self.w = FloatingWindow((200, 200), self.title, closable=False)
    glyph = Glyphs.font.selectedLayers[0]
    self.w.Preview = GlyphPreview((0, 0, 0, 0), glyph=glyph)
    self.w.Preview.mouseDoubleDownCallBack = self.mouseDoubleDown
    self.w.open()
def mouseDoubleDown(self, sender):
    print "Mouse Double Down"
        
GlyphPreviewDemo()

objc.error: GlyphPreviewView is overriding existing Objective-C class

Symptom 2
when I run plugin which has almost the same code above, it runs without error. But, ‘mouseDoubleClick’ shut down Glyphs. Though I set ‘try, except’, it even shut down Glyphs without printing it. The same code was okay before I got Symptom 1.

Is there a way to reset Glyphs or solve the problem?

Number 1 is the same problem that we have with robofab right now. It imports the module twice and thous causing confusion with the classes

The second issue can be debugged by sending the script output to the system console. There is a checkbox for this in Preference > User Setting.

Could you send me the code with the mouseDoubleClick that I can try to debug it?

1 Like