-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Curve Preview doesn’t work reliably #13
Comments
I'm aware of this. This happens since I reimplemented the extension with the "modern" RF API. An (annoying) workaround is to click in another window after starting the extension via shortcut, then click back into the glyph window. That will activate the UI and make everything functional. @typemytype do you have any idea how to avoid this behaviour? |
I see the issue. The solution is not to combine everything in a single subscriber instance, which is just harder to maintain A better approach is to have window Controller and a glyph editor subscriber, the controller becomes an attribute of the glyph editor subscriber I hope this template helps (let me know) import vanilla
from mojo.subscriber import Subscriber, WindowController, registerGlyphEditorSubscriber, unregisterGlyphEditorSubscriber
class MyGlyphSubscriber(Subscriber):
debug = True
controller = None
def build(self):
print("build")
self.controller.addInfo("build")
def started(self):
print("subscription started")
self.controller.addInfo("subscription started")
def destroy(self):
print("stop subscription")
self.controller.addInfo("stop subscription")
def glyphEditorGlyphDidChangeOutline(self, info):
print("did change outline")
self.controller.addInfo("did change outline")
class MyController(WindowController):
glyphEditorSubscriberClass = MyGlyphSubscriber
def build(self):
print("build")
self.w = vanilla.Window((200, 200), "Controller")
self.w.t = vanilla.TextEditor((0, 0, 0, 0))
self.w.open()
def started(self):
print("started")
self.glyphEditorSubscriberClass.controller = self
registerGlyphEditorSubscriber(self.glyphEditorSubscriberClass)
def destroy(self):
print("windowCLose")
unregisterGlyphEditorSubscriber(self.glyphEditorSubscriberClass)
self.glyphEditorSubscriberClass.controller = None
# callbacks
def addInfo(self, info):
d = self.w.t.get()
self.w.t.set(d + "\n" + info)
OpenWindow(MyController) |
@jenskutilek |
Add: No big thing, just thought I add my findings. PS: decomposing the component of course solves this problem. |
Baby steps ... the latest version 2.1.3 can handle glyphs with components and outlines. Other improvements to come. |
Hello,
the boxes in the settings are all checked, yet the preview doesn’t work reliably. I see it sometimes, but most of the time I don’t.
Also: the UI is greyed out when I open the CE via the shortcut while not having a segment in my current selection. Selecting a segment after opening does not change the state of the UI. (I believe that was not an issue with the previous version and RF3).
CE Version 2.0.3 (current Mechanic2 version)
RF 4.1 (most current version)
Monterey 12.0.1
The text was updated successfully, but these errors were encountered: