Ejemplo n.º 1
0
def selectable(label, selected, *args, **kwargs):
    """ Selectable line.

    This widget marks the whole line as selectable. To add widgets to `selectable`,
    simply append them using `orr_same_line`:

    ```python
    c.orr_same_line([
        c.selectable("Selectable", False),
        c.text("Extra text"),
        ])
    ```
     """
    return interactive_elem(imgui.selectable, label, selected, *args, **kwargs)
Ejemplo n.º 2
0
def menu_item(label,
              shortcut=None,
              selected=False,
              enabled=True,
              *args,
              **kwargs):
    """ Create a menu item.

    Menu items should be nested inside `menu`.

    Item shortcuts are displayed for convenience, but are not processed in any way.
    They are easily handled by `key_press` outside the menu code If `key_press` was
    inside the menu, it would not be active when the menu is not expanded.
    Items may have a check-box (`selected`), and may or may not be `enabled`.
    """
    return interactive_elem(imgui.menu_item, label, shortcut, selected,
                            enabled, *args, **kwargs)
Ejemplo n.º 3
0
def slider_float(label, value, min_value, max_value, *args, **kwargs):
    """ Float selection slider. """
    return interactive_elem(imgui.slider_float, label, value, min_value,
                            max_value, *args, **kwargs)
Ejemplo n.º 4
0
def input_float(label, value, *args, **kwargs):
    """ Float input widget. """
    return interactive_elem(imgui.input_float, label, value, *args, **kwargs)
Ejemplo n.º 5
0
def drag_int4(label, values, *args, **kwargs):
    """ Integer selection widget without a slider for selecting four `values`. """
    value0, value1, value2, value3 = values
    return interactive_elem(imgui.drag_int4, label, value0, value1, value2,
                            value3, *args, **kwargs)
Ejemplo n.º 6
0
def drag_int3(label, values, *args, **kwargs):
    """ Integer selection widget without a slider for selecting three `values`. """
    value0, value1, value2 = values
    return interactive_elem(imgui.drag_int3, label, value0, value1, value2,
                            *args, **kwargs)
Ejemplo n.º 7
0
def drag_int(label, value, *args, **kwargs):
    """ Integer selection widget without a slider. """
    return interactive_elem(imgui.drag_int, label, value, *args, **kwargs)
Ejemplo n.º 8
0
def drag_float2(label, values, *args, **kwargs):
    """ Float selection widget without a slider for selecting two `values`. """
    value0, value1 = values
    return interactive_elem(imgui.drag_float2, label, value0, value1, *args,
                            **kwargs)
Ejemplo n.º 9
0
def checkbox(label, checked, *args, **kwargs):
    """ Two-state checkbox. """
    return interactive_elem(imgui.checkbox, label, checked, *args, **kwargs)