Basic Widgets

Summary

Text

A basic element that displays some text.

LabelText

Display text with a label.

Separator

Adds a horizontal line.

ProgressBar

A progress bar.

Button

A simple button.

ButtonArrow

Specifies direction for arrow buttons.

Checkbox

Simple checkbox widget.

Selectable

Text that can be selected, functionally similar to a checkbox.

RadioButtons

A set of radio buttons.

ListBox

A scrollable box containing a selection of items.

Combo

A combo box (drop down).

ComboHeightMode

Specifies the height of a combo box.

SimplePlot

A simple plot to visualize a sequence of float values.

Basic Content

class dearpygui_obj.basic.Text(value: str = '', **config)[source]

Bases: dearpygui_obj.wrapper.widget.Widget, dearpygui_obj.wrapper.widget.ItemWidgetMx, dearpygui_obj.wrapper.widget.ValueWidgetMx[str]

A basic element that displays some text.

value: str

The text to display.

wrap: int

Wrap after this many characters. Set to -1 to disable.

bullet: bool

Display a bullet point with the text.

color: ColorRGBA

Read or modify the ‘color’ config property.

class dearpygui_obj.basic.LabelText(label: Optional[str] = None, value: str = '', **config)[source]

Bases: dearpygui_obj.wrapper.widget.Widget, dearpygui_obj.wrapper.widget.ItemWidgetMx, dearpygui_obj.wrapper.widget.ValueWidgetMx[str]

Display text with a label.

Useful for output values when used with a data_source. The text is linked to the data source, while the label remains unchanged.

value: str

The text to display (separate from the label).

label: str

Read or modify the ‘label’ config property.

color: ColorRGBA

Read or modify the ‘color’ config property.

class dearpygui_obj.basic.Separator(**config)[source]

Bases: dearpygui_obj.wrapper.widget.Widget, dearpygui_obj.wrapper.widget.ItemWidgetMx

Adds a horizontal line.

class dearpygui_obj.basic.ProgressBar(value: float = 0.0, **config)[source]

Bases: dearpygui_obj.wrapper.widget.Widget, dearpygui_obj.wrapper.widget.ItemWidgetMx, dearpygui_obj.wrapper.widget.ValueWidgetMx[float]

A progress bar.

value: float

The progress to display, between 0.0 and 1.0.

overlay_text: str

Overlayed text.

Button-Like

class dearpygui_obj.basic.Button(label: Optional[str] = None, **config)[source]

Bases: dearpygui_obj.wrapper.widget.Widget, dearpygui_obj.wrapper.widget.ItemWidgetMx

A simple button.

label: str

Read or modify the ‘label’ config property.

small: bool

If True, makes the button a small button. Useful for embedding in text.

arrow: Optional[ButtonArrow]

Configure the button as an arrow button.

If the button is an arrow button, the value will be the arrow direction. Otherwise the value will be None.

Assigning to this property will enable/disable the arrow and/or set the direction.

class dearpygui_obj.basic.ButtonArrow(value)[source]

Bases: enum.Enum

Specifies direction for arrow buttons.

Left = 0
Right = 1
Up = 2
Down = 3
class dearpygui_obj.basic.Checkbox(label: Optional[str] = None, value: bool = False, **config)[source]

Bases: dearpygui_obj.wrapper.widget.Widget, dearpygui_obj.wrapper.widget.ItemWidgetMx, dearpygui_obj.wrapper.widget.ValueWidgetMx[bool]

Simple checkbox widget.

value: bool

True if the checkbox is checked, otherwise False.

label: str

Read or modify the ‘label’ config property.

class dearpygui_obj.basic.Selectable(label: Optional[str] = None, value: bool = False, **config)[source]

Bases: dearpygui_obj.wrapper.widget.Widget, dearpygui_obj.wrapper.widget.ItemWidgetMx, dearpygui_obj.wrapper.widget.ValueWidgetMx[bool]

Text that can be selected, functionally similar to a checkbox.

value: bool

True if the item is selected, otherwise False.

label: str

Read or modify the ‘label’ config property.

span_columns: bool

Read or modify the ‘span_columns’ config property.

Selection List

class dearpygui_obj.basic.RadioButtons(items: Iterable[str], value: int = 0, **config)[source]

Bases: dearpygui_obj.wrapper.widget.Widget, dearpygui_obj.wrapper.widget.ItemWidgetMx, dearpygui_obj.wrapper.widget.ValueWidgetMx[int], MutableSequence[str]

A set of radio buttons.

This widget can be used as a mutable sequence of labels. Changing the sequence will change the radio buttons in the group and their labels.

value: int

The index of the selected item.

horizontal: bool

Read or modify the ‘horizontal’ config property.

items: Sequence[str]

Get or set this widget’s items as a sequence.

__len__() int[source]
__getitem__(idx: int) str[source]
__getitem__(idx: slice) Iterable[str]
__setitem__(idx: int, label: str) None[source]
__setitem__(idx: slice, label: Iterable[str]) None
__delitem__(idx: int) None[source]
__delitem__(idx: slice) None
insert(idx: int, label: str) None[source]

S.insert(index, value) – insert value before index

class dearpygui_obj.basic.ListBox(label: str = None, items: Iterable[str] = (), value: int = 0, **config)[source]

Bases: dearpygui_obj.wrapper.widget.Widget, dearpygui_obj.wrapper.widget.ItemWidgetMx, dearpygui_obj.wrapper.widget.ValueWidgetMx[int], MutableSequence[str]

A scrollable box containing a selection of items.

value: int

The index of the selected item.

label: str

Read or modify the ‘label’ config property.

num_visible: int

The number of items to show.

items: Sequence[str]

Get or set this widget’s items as a sequence.

__len__() int[source]
__getitem__(idx: int) str[source]
__getitem__(idx: slice) Iterable[str]
__setitem__(idx: int, label: str) None[source]
__setitem__(idx: slice, label: Iterable[str]) None
__delitem__(idx: int) None[source]
__delitem__(idx: slice) None
insert(idx: int, label: str) None[source]

S.insert(index, value) – insert value before index

class dearpygui_obj.basic.Combo(label: str = None, items: Iterable[str] = (), value: str = '', **config)[source]

Bases: dearpygui_obj.wrapper.widget.Widget, dearpygui_obj.wrapper.widget.ItemWidgetMx, dearpygui_obj.wrapper.widget.ValueWidgetMx[str], MutableSequence[str]

A combo box (drop down).

Unlike RadioButtons, the value of a Combo is one of the item strings, not the index.

Unless specified, none of the items are initially selected and value is an empty string.

value: str

The string value of the selected item.

label: str

Read or modify the ‘label’ config property.

popup_align_left: bool

Read or modify the ‘popup_align_left’ config property.

no_arrow_button: bool

Don’t display the arrow button.

no_preview: bool

Don’t display the preview box showing the selected item.

items: Sequence[str]

Get or set this widget’s items as a sequence.

height_mode: ComboHeightMode

Read or modify the ‘height’ config property.

__len__() int[source]
__getitem__(idx: int) str[source]
__getitem__(idx: slice) Iterable[str]
__setitem__(idx: int, label: str) None[source]
__setitem__(idx: slice, label: Iterable[str]) None
__delitem__(idx: int) None[source]
__delitem__(idx: slice) None
insert(idx: int, label: str) None[source]

S.insert(index, value) – insert value before index

class dearpygui_obj.basic.ComboHeightMode(value)[source]

Bases: enum.Enum

Specifies the height of a combo box.

Small = 'height_small'

Max ~4 items visible.

Regular = 'height_regular'

Max ~8 items visible.

Large = 'height_large'

Max ~20 items visible.

Largest = 'height_largest'

As many items visible as possible.

Simple Plots

class dearpygui_obj.basic.SimplePlot(label: Optional[str] = None, **config)[source]

Bases: dearpygui_obj.wrapper.widget.Widget, dearpygui_obj.wrapper.widget.ItemWidgetMx, dearpygui_obj.wrapper.widget.ValueWidgetMx[Sequence[float]]

A simple plot to visualize a sequence of float values.

label: str

Read or modify the ‘label’ config property.

title: str

Overlays text (similar to a plot title).

minscale: float

Read or modify the ‘minscale’ config property.

maxscale: float

Read or modify the ‘maxscale’ config property.

histogram: bool

Read or modify the ‘histogram’ config property.