<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[inspectorWindowWillShowDescriptions?]]></title><description><![CDATA[<p dir="auto">Re: <a href="/topic/605/ability-to-customize-existing-inspector">Ability to customize existing Inspector</a></p>
<p dir="auto">I am working on a tool that lives in the inspector window, I think that it's important to note that the tool is dependent on a font and not an individual glyph that <code>inspectorWindowWillShowDescriptions</code> can provide. Anyways, I am running into an issue when a font is open before the inspector window, where the values are not being set despite the function running. I have it set up so the tool's <code>EditText.enable</code> is set to false by default just in case there is no font open when the window is originally opened. I hope this makes sense:) Any help is greatly appreciated!!</p>
]]></description><link>https://forum.robofont.com/topic/813/inspectorwindowwillshowdescriptions</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 08:01:05 GMT</lastBuildDate><atom:link href="https://forum.robofont.com/topic/813.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 04 Mar 2020 17:33:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to inspectorWindowWillShowDescriptions? on Wed, 15 Apr 2020 09:47:30 GMT]]></title><description><![CDATA[<p dir="auto">Re: <a href="/topic/605/ability-to-customize-existing-inspector">Ability to customize existing Inspector</a></p>
<p dir="auto">I am working on a tool that lives in the inspector window, I think that it's important to note that the tool is dependent on a font and not an individual glyph that <code>inspectorWindowWillShowDescriptions</code> can provide. Anyways, I am running into an issue when a font is open before the inspector window, where the values are not being set despite the function running. I have it set up so the tool's <code>EditText.enable</code> is set to false by default just in case there is no font open when the window is originally opened. I hope this makes sense:) Any help is greatly appreciated!!</p>
]]></description><link>https://forum.robofont.com/post/3081</link><guid isPermaLink="true">https://forum.robofont.com/post/3081</guid><dc:creator><![CDATA[connor]]></dc:creator><pubDate>Wed, 15 Apr 2020 09:47:30 GMT</pubDate></item><item><title><![CDATA[Reply to inspectorWindowWillShowDescriptions? on Wed, 04 Mar 2020 20:45:16 GMT]]></title><description><![CDATA[<p dir="auto">I'm not sure if I fully understand the issue you're running into, but in <a href="https://github.com/ryanbugden/Sidebear/blob/master/Sidebear.roboFontExt/lib/Sidebear.py" rel="nofollow">Sidebear</a>, the <code>EditText</code> fields react to other observers like <code>glyphChanged</code> and can probably react to the likes of <code>fontWillOpen</code>?</p>
]]></description><link>https://forum.robofont.com/post/3083</link><guid isPermaLink="true">https://forum.robofont.com/post/3083</guid><dc:creator><![CDATA[ryan]]></dc:creator><pubDate>Wed, 04 Mar 2020 20:45:16 GMT</pubDate></item><item><title><![CDATA[Reply to inspectorWindowWillShowDescriptions? on Wed, 04 Mar 2020 22:13:10 GMT]]></title><description><![CDATA[<p dir="auto">Sorry, I knew that made no sense!</p>
<p dir="auto">So, my tool displays some custom lib keys, currently, there is no issue with it noticing a new font (this is actually working great). The problem is only when the font is open prior to the inspector window. Even if you close the inspector and re-open, the data isn't being displayed anymore. I tried to use <code>inspectorWindowWillShowDescriptions</code> to trigger the tool to reset the values but no luck. 🤦‍♂️</p>
]]></description><link>https://forum.robofont.com/post/3085</link><guid isPermaLink="true">https://forum.robofont.com/post/3085</guid><dc:creator><![CDATA[connor]]></dc:creator><pubDate>Wed, 04 Mar 2020 22:13:10 GMT</pubDate></item><item><title><![CDATA[Reply to inspectorWindowWillShowDescriptions? on Wed, 04 Mar 2020 22:25:20 GMT]]></title><description><![CDATA[<p dir="auto">When building Sidebear, I had an issue where I couldn't generate two independent panels at once (with two fonts open). Either the panel would be empty on a new font, or a one panel would be showing information from the glyph in the other font.</p>
<p dir="auto">The issue I was running into was a structural problem, and Just van Rossum pointed that out. He put the insertion of the inspector panel into its own independent class. You can see that at the bottom of the code. TBH I still don't quite understand fundamentally why it works now; I would describe it as making each panel object independently of one another, rather than trying to start the same one up again and again.</p>
<p dir="auto">...</p>
<p dir="auto">Now, that may not be applicable to your situation, but thought I'd rant about that. One piece that I learned in the process that may clarify things for you: if you're in Single Window Mode, <code>inspectorWindowWillShowDescriptions</code> only runs the first time, I believe when the font itself is opened. If you hide/reveal the inspector, it's doing just that—hiding and revealing—the observer won't be tipped off.</p>
<p dir="auto">If you're not in Single Window Mode, and you have the necessary updates under <code>inspectorWindowWillShowDescriptions</code>’s callbacks, then I'm not sure I can help, but happy to look at the code in a less abstract sense.</p>
]]></description><link>https://forum.robofont.com/post/3086</link><guid isPermaLink="true">https://forum.robofont.com/post/3086</guid><dc:creator><![CDATA[ryan]]></dc:creator><pubDate>Wed, 04 Mar 2020 22:25:20 GMT</pubDate></item><item><title><![CDATA[Reply to inspectorWindowWillShowDescriptions? on Thu, 05 Mar 2020 10:42:00 GMT]]></title><description><![CDATA[<p dir="auto">hello <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.robofont.com/uid/213">@connor</a>,</p>
<p dir="auto">I’ve tried to reproduce the situation you describe in the script below.</p>
<blockquote>
<p dir="auto">The problem is only when the font is open prior to the inspector window.</p>
</blockquote>
<p dir="auto">if I understand it correctly, the problem happens because there is no font event triggered after the panel is added. this can be solved by updating the font when the panel is created (see comment).</p>
<pre><code class="language-python">from vanilla import Group, TextBox
from mojo.UI import AccordionView
from mojo.events import addObserver

class MyCustomPanel:

    height = 120

    def __init__(self):
        self.w = Group((0, 0, -0, -0))
        self.w.currentFontLabel = TextBox((10, 10, 50, 22), 'font:')
        self.w.currentFont = TextBox((60, 10, -10, 22), '')
        self.w.currentGlyphLabel = TextBox((10, 40, 50, 22), 'glyph:')
        self.w.currentGlyph = TextBox((60, 40, -10, 22), '')
        addObserver(self, "updateFont", "fontBecameCurrent")
        addObserver(self, "updateFont", "fontDidOpen")
        addObserver(self, "updateFont", "fontDidClose")
        addObserver(self, "updateGlyph", "currentGlyphChanged")
        ### update with already open font
        self.updateFont(None)
        self.updateGlyph(None)

    def updateFont(self, notification):
        f = CurrentFont()
        fontName = f'{f.info.familyName} {f.info.styleName}' if f else '[none]'
        self.w.currentFont.set(fontName)

    def updateGlyph(self, notification):
        g = CurrentGlyph()
        glyphName = g.name if g is not None else '[none]'
        self.w.currentGlyph.set(glyphName)

class PanelInsert:

    def __init__(self):
        addObserver(self, "insertPanel", "inspectorWindowWillShowDescriptions")

    def insertPanel(self, notification):
        print('adding custom panel')
        title = "My Panel"
        myPanel = MyCustomPanel()
        item = dict(label=title, view=myPanel.w, size=myPanel.height, collapsed=False, canResize=False)
        if notification["descriptions"][1]['label'] == title:
            del notification["descriptions"][1]
        notification["descriptions"].insert(1, item)

PanelInsert()
</code></pre>
<p dir="auto">I hope this makes sense! cheers</p>
]]></description><link>https://forum.robofont.com/post/3088</link><guid isPermaLink="true">https://forum.robofont.com/post/3088</guid><dc:creator><![CDATA[gferreira]]></dc:creator><pubDate>Thu, 05 Mar 2020 10:42:00 GMT</pubDate></item><item><title><![CDATA[Reply to inspectorWindowWillShowDescriptions? on Thu, 05 Mar 2020 14:40:36 GMT]]></title><description><![CDATA[<p dir="auto">Oh my, I really did overthink the issue — reorganizing my functions just a little and adding the<br />
<code>self.updateFont(None)</code> solved it!!<br />
Thanks for the help, Gustavo!</p>
]]></description><link>https://forum.robofont.com/post/3091</link><guid isPermaLink="true">https://forum.robofont.com/post/3091</guid><dc:creator><![CDATA[connor]]></dc:creator><pubDate>Thu, 05 Mar 2020 14:40:36 GMT</pubDate></item></channel></rss>