Exemple #1
0
def window(name: str,
           width: int = -1,
           height: int = -1,
           start_x: int = 200,
           start_y: int = 200,
           autosize: bool = False,
           resizable: bool = True,
           title_bar: bool = True,
           movable: bool = True,
           hide: bool = False,
           on_close: str = ""):
    try:
        yield gui.add_window(name,
                             width,
                             height,
                             start_x=start_x,
                             start_y=start_y,
                             autosize=autosize,
                             resizable=resizable,
                             title_bar=title_bar,
                             movable=movable,
                             hide=hide,
                             on_close=on_close)
    finally:
        gui.end()
Exemple #2
0
 def __init__(self,
              *args: Any,
              parent: str = 'None',
              before: str = None,
              **kwargs: Any):
     super().__init__(parent=parent, before=before)
     self.__setup_content__(*args, **kwargs)
     dpgcore.end()
Exemple #3
0
def tree_node(name: str,
              default_open: bool = False,
              tip: str = "",
              parent: str = "",
              before: str = ""):
    try:
        yield gui.add_tree_node(name,
                                default_open=default_open,
                                tip=tip,
                                parent=parent,
                                before=before)
    finally:
        gui.end()
Exemple #4
0
def tab(name: str,
        closable: bool = False,
        tip: str = "",
        parent: str = "",
        before: str = ""):
    try:
        yield gui.add_tab(name,
                          closable=closable,
                          tip=tip,
                          parent=parent,
                          before=before)
    finally:
        gui.end()
Exemple #5
0
def collapsing_header(name: str,
                      default_open: bool = False,
                      closable: bool = False,
                      tip: str = "",
                      parent: str = "",
                      before: str = ""):
    try:
        yield gui.add_collapsing_header(name,
                                        default_open=default_open,
                                        closable=closable,
                                        tip=tip,
                                        parent=parent,
                                        before=before)
    finally:
        gui.end()
Exemple #6
0
def tab_bar(name: str,
            reorderable: bool = False,
            callback: str = "",
            parent: str = "",
            before: str = "",
            data_source: str = ""):
    try:
        yield gui.add_tab_bar(name,
                              reorderable=reorderable,
                              callback=callback,
                              parent=parent,
                              before=before,
                              data_source=data_source)
    finally:
        gui.end()
Exemple #7
0
def child(name: str,
          tip: str = "",
          parent: str = "",
          before: str = "",
          width: int = 0,
          height: int = 0,
          border: bool = True):
    try:
        yield gui.add_child(name,
                            tip=tip,
                            parent=parent,
                            before=before,
                            width=width,
                            height=height,
                            border=border)
    finally:
        gui.end()
Exemple #8
0
def group(name: str,
          tip: str = "",
          parent: str = "",
          before: str = "",
          width: int = 0,
          hide: bool = False,
          horizontal: bool = False,
          horizontal_spacing: float = -1.0):
    try:
        yield gui.add_group(name,
                            tip=tip,
                            parent=parent,
                            before=before,
                            width=width,
                            hide=hide,
                            horizontal=horizontal,
                            horizontal_spacing=horizontal_spacing)
    finally:
        gui.end()
Exemple #9
0
def popup(popupparent: str,
          name: str,
          mousebutton: int = 1,
          modal: bool = False,
          parent: str = "",
          before: str = "",
          width: int = 0,
          height: int = 0):
    try:
        yield gui.add_popup(popupparent,
                            name,
                            mousebutton=mousebutton,
                            modal=modal,
                            parent=parent,
                            before=before,
                            width=width,
                            height=height)
    finally:
        gui.end()
Exemple #10
0
def container(f, name, *args, **kwds):
    yield f(name, *args, **kwds)
    end()
Exemple #11
0
 def container_context(*args, **kwargs):
     try:
         yield container(*args, **kwargs)
     finally:
         gui.end()
Exemple #12
0
def menu(name: str, tip: str = "", parent: str = "", before: str = ""):
    try:
        yield gui.add_menu(name, tip=tip, parent=parent, before=before)
    finally:
        gui.end()
Exemple #13
0
def menu_bar(name: str, parent: str = "", before: str = ""):
    try:
        yield gui.add_menu_bar(name, parent=parent, before=before)
    finally:
        gui.end()
Exemple #14
0
def tooltip(tipparent: str, name: str, parent: str = "", before: str = ""):
    try:
        yield gui.add_tooltip(tipparent, name, parent=parent, before=before)
    finally:
        gui.end()
Exemple #15
0
 def __finalize__(self) -> None:
     """Should finalize the container in DPG."""
     dpgcore.end()
Exemple #16
0
 def __setup_add_widget__(self, dpg_args) -> None:
     dpgcore.add_doc_window(self.id, **dpg_args)
     dpgcore.end()