step 4: add digital bar level and status gauges
This commit is contained in:
33
examples/basic_bar.py
Normal file
33
examples/basic_bar.py
Normal file
@@ -0,0 +1,33 @@
|
||||
# pyright: reportGeneralTypeIssues=false
|
||||
|
||||
import dearpygui.dearpygui as dpg
|
||||
|
||||
import dpg_gauges as dpgg
|
||||
|
||||
|
||||
def main() -> None:
|
||||
dpg.create_context()
|
||||
try:
|
||||
with dpg.window(label="Bar Gauge", width=360, height=180):
|
||||
dpgg.bar_gauge(
|
||||
tag="boost",
|
||||
label="Boost",
|
||||
value=18.5,
|
||||
min_value=0,
|
||||
max_value=30,
|
||||
unit="psi",
|
||||
precision=1,
|
||||
width=300,
|
||||
height=100,
|
||||
)
|
||||
|
||||
dpg.create_viewport(title="dpg-gauges bar", width=400, height=220)
|
||||
dpg.setup_dearpygui()
|
||||
dpg.show_viewport()
|
||||
dpg.start_dearpygui()
|
||||
finally:
|
||||
dpg.destroy_context()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user