base.py (770B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\carbonui\window\header\base.py 2 import weakref 3 from carbonui.primitives.base import Base 4 5 class WindowHeaderBase(Base): 6 COLLAPSED_HEIGHT = 32 7 HAS_SUFFICIENT_BOTTOM_PADDING = False 8 9 def __init__(self, **kwargs): 10 self.__window_ref = None 11 super(WindowHeaderBase, self).__init__(**kwargs) 12 13 @property 14 def window(self): 15 window = self.__window_ref() if self.__window_ref is not None else None 16 if window is not None and not window.closing: 17 return window 18 else: 19 return 20 21 def mount(self, window): 22 self.__window_ref = weakref.ref(window) 23 24 def unmount(self, window): 25 self.__window_ref = None