fontlab.YPanelManager
YPanelManager
PythonQtInstanceWrapper object
Dockable panel system.
What is YPanelManager?
FontLab's sidebar and panel system is managed by YPanelManager. Every dockable panel you see in FontLab — the Layers panel, the Glyph panel, the Properties panel — is registered with and managed by this singleton.
If you want to create a custom side panel that always appears in the FontLab UI (rather than a separate window), you subclass YPanelWidget and register it with YPanelManager.instance().
Getting the instance
There is always exactly one YPanelManager in a running FontLab:
from fontlab import YPanelManager
pm = YPanelManager.instance()
Tutorial
YPanelManager lets you open, close, and inspect FontLab's dockable panels. Here is how to work with both the built-in panels and your own custom ones.
import fontlab as fl
from fontlab import YPanelManager, YPanelWidget
# ============================================================
# Get the panel manager singleton.
# ============================================================
pm = YPanelManager.instance()
print(f"Registered panels: {len(pm.registeredPanels)}")
for panel in pm.registeredPanels:
visible = pm.panelVisible(panel)
status = "open" if visible else "closed"
print(f" [{status}] id={panel.id:3d} '{panel.title}'")
print(f"\nCurrently open: {len(pm.panels)}")
# ============================================================
# Toggle a panel open/closed by its title.
# ============================================================
target_title = "Layers" # change to any panel title you see above
target_panel = next(
(p for p in pm.registeredPanels if p.title == target_title), None
)
if target_panel:
if pm.panelVisible(target_panel):
pm.closePanel(target_panel)
print(f"Closed '{target_title}'")
else:
pm.openPanel(target_panel)
print(f"Opened '{target_title}'")
else:
print(f"Panel '{target_title}' not found.")
# ============================================================
# Create and register a minimal custom panel.
# (Full UI requires Qt widgets from PyQt5 or PySide2.)
# ============================================================
# class MyInfoPanel(YPanelWidget):
# def __init__(self):
# super().__init__()
# self.title = "Glyph Info"
# self.defaultEdge = 2 # right side
# self.minimumPanelSize = fl.QSize(200, 150)
#
# panel = MyInfoPanel()
# pm.registerPanel(panel)
# pm.openPanel(panel)
# print(f"Custom panel id={panel.id}")
Common Scripting Patterns
Find a panel by ID and activate it
from fontlab import YPanelManager
pm = YPanelManager.instance()
panel = pm.findPanelWidget(1) # replace 1 with the actual id
if panel:
pm.activatePanel(panel)
print(f"Activated '{panel.title}'")
Open a panel as a floating window
from fontlab import YPanelManager
from PyQt5.QtCore import Qt
pm = YPanelManager.instance()
panel = next((p for p in pm.registeredPanels if 'Layers' in p.title), None)
if panel:
pm.openFloatingPanel(panel, Qt.Vertical, Qt.RightEdge)
print("Layers panel opened as floating window.")
Native bases: PythonQtInstanceWrapper
Captured native MRO: YPanelManager, PythonQtInstanceWrapper, object
Native new allocation evidence (not an init overload): (args, *kwargs) Create and return a new object. See help(type) for accurate signature.
Supplemental documentation:
A panel manager. The captured declaration exposes the signals desktopClientRectChanged, panelClosed, toolbarOpened and toolbarClosed and the method showContextMenu. It also carries the Qt object members parent, children, findChild, findChildren, setParent, connect, disconnect, deleteLater and property, and the attribute objectName. It is created with no captured constructor overloads.
Source: FontLab Proteus API documentation
Source: generated/fontlab.py: YPanelManager captured declaration
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
__init__ |
function | (self, /, *args: Any, **kwargs: Any) -> None |
Initialize self. (shared captured text) |
blockSignals |
function | (self, b: Any) -> bool |
X.blockSignals(b) -> bool (shared captured text) |
childEvent |
function | (self, event: Any) -> Any |
(shared captured text) |
children |
function | (self) -> tuple |
X.children() -> tuple (shared captured text) |
className |
function | (self, *args: Any, **kwargs: Any) -> Any |
Return the classname of the object (shared captured text) |
connect |
function | (self, signal: Any, receiver: Any, slot: Any, type: Any) -> bool |
X.connect(signal, receiver, slot, type) -> bool (shared captured text) |
customEvent |
function | (self, event: Any) -> Any |
(shared captured text) |
delete |
function | (self, *args: Any, **kwargs: Any) -> Any |
Deletes the C++ object (at your own risk, my friend!) (shared captured text) |
deleteLater |
function | (self) -> Any |
(shared captured text) |
desktopClientRectChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native fontlab.YPanelManager.desktopClientRectChanged; argument details are not documented. |
destroyed |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native fontlab.YPanelManager.destroyed; argument details are not documented. |
disconnect |
function | (self, signal: Any, receiver: Any, slot: Any) -> bool |
X.disconnect(signal, receiver, slot) -> bool (shared captured text) |
dumpObjectInfo |
function | (self) -> Any |
(shared captured text) |
dumpObjectTree |
function | (self) -> Any |
(shared captured text) |
dynamicPropertyNames |
function | (self) -> Any |
(shared captured text) |
event |
function | (self, event: Any) -> bool |
X.event(event) -> bool (shared captured text) |
eventFilter |
function | (self, watched: Any, event: Any) -> bool |
X.eventFilter(watched, event) -> bool (shared captured text) |
findChild |
function | (self, type: Any, name: Any) -> Any |
X.findChild(type, name) -> PythonQt.private.QObject (shared captured text) |
findChildren |
function | (self, type: Any, name: Any) -> tuple |
X.findChildren(type, name) -> tuple (shared captured text) |
help |
function | (self, *args: Any, **kwargs: Any) -> Any |
Shows the help of available methods for this class (shared captured text) |
inherits |
function | (self, *args: Any, **kwargs: Any) -> Any |
Returns if the class inherits or is of given type name (shared captured text) |
installEventFilter |
function | (self, filterObj: Any) -> Any |
(shared captured text) |
isSignalConnected |
function | (self, signal: Any) -> bool |
X.isSignalConnected(signal) -> bool (shared captured text) |
isWidgetType |
function | (self) -> bool |
X.isWidgetType() -> bool (shared captured text) |
isWindowType |
function | (self) -> bool |
X.isWindowType() -> bool (shared captured text) |
killTimer |
function | (self, id: Any) -> Any |
(shared captured text) |
metaObject |
function | (self) -> Any |
X.metaObject() -> PythonQt.QtCore.QMetaObject (shared captured text) |
moveToThread |
function | (self, thread: Any) -> Any |
(shared captured text) |
objectName |
attribute | Any |
(shared captured text) |
objectNameChanged |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native fontlab.YPanelManager.objectNameChanged; argument details are not documented. |
panelClosed |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native fontlab.YPanelManager.panelClosed; argument details are not documented. |
parent |
function | (self) -> Any |
X.parent() -> PythonQt.private.QObject (shared captured text) |
property |
function | (self, name: Any) -> Any |
X.property(name) -> object (shared captured text) |
removeEventFilter |
function | (self, obj: Any) -> Any |
(shared captured text) |
sender |
function | (self) -> Any |
X.sender() -> PythonQt.private.QObject (shared captured text) |
senderSignalIndex |
function | (self) -> int |
X.senderSignalIndex() -> int (shared captured text) |
setObjectName |
function | (self, name: Any) -> Any |
(shared captured text) |
setParent |
function | (self, parent: Any) -> Any |
(shared captured text) |
setProperty |
function | (self, name: Any, value: Any) -> bool |
X.setProperty(name, value) -> bool (shared captured text) |
showContextMenu |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native fontlab.YPanelManager.showContextMenu; argument details are not documented. |
signalsBlocked |
function | (self) -> bool |
X.signalsBlocked() -> bool (shared captured text) |
startTimer |
function | (self, interval: Any, timerType: Any) -> int |
X.startTimer(interval, timerType) -> int (shared captured text) |
thread |
function | (self) -> Any |
(shared captured text) |
timerEvent |
function | (self, event: Any) -> Any |
(shared captured text) |
toolbarClosed |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native fontlab.YPanelManager.toolbarClosed; argument details are not documented. |
toolbarOpened |
function | (self, *args: Any, **kwargs: Any) -> Any |
Native fontlab.YPanelManager.toolbarOpened; argument details are not documented. |
tr |
function | (self, text: Any, ambig: Any, n: Any) -> str |
X.tr(text, ambig, n) -> str (shared captured text) |