starting to get decent compression
This commit is contained in:
@@ -114,3 +114,28 @@ class _ScopeId:
|
||||
def __exit__(self, *args):
|
||||
imgui.pop_id()
|
||||
return False
|
||||
|
||||
def tab_bar(id_str: str, flags: int = 0): return _ScopeTabBar(id_str, flags)
|
||||
class _ScopeTabBar:
|
||||
def __init__(self, id_str: str, flags: int):
|
||||
self._id = id_str
|
||||
self._flags = flags
|
||||
def __enter__(self):
|
||||
return imgui.begin_tab_bar(self._id, self._flags)
|
||||
def __exit__(self, *args):
|
||||
imgui.end_tab_bar()
|
||||
return False
|
||||
|
||||
def tab_item(label: str, flags: int = 0): return _ScopeTabItem(label, flags)
|
||||
class _ScopeTabItem:
|
||||
def __init__(self, label: str, flags: int):
|
||||
self._label = label
|
||||
self._flags = flags
|
||||
self._open = None
|
||||
def __enter__(self):
|
||||
self._open = imgui.begin_tab_item(self._label, self._flags)
|
||||
return self._open
|
||||
def __exit__(self, *args):
|
||||
if self._open[0]:
|
||||
imgui.end_tab_item()
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user