step 4: add digital bar level and status gauges
This commit is contained in:
30
examples/basic_level.py
Normal file
30
examples/basic_level.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# pyright: reportGeneralTypeIssues=false
|
||||
|
||||
import dearpygui.dearpygui as dpg
|
||||
|
||||
import dpg_gauges as dpgg
|
||||
|
||||
|
||||
def main() -> None:
|
||||
dpg.create_context()
|
||||
try:
|
||||
with dpg.window(label="Level Gauge", width=260, height=320):
|
||||
dpgg.level_gauge(
|
||||
tag="fuel",
|
||||
label="Fuel",
|
||||
value=68,
|
||||
unit="%",
|
||||
width=180,
|
||||
height=240,
|
||||
)
|
||||
|
||||
dpg.create_viewport(title="dpg-gauges level", width=300, height=360)
|
||||
dpg.setup_dearpygui()
|
||||
dpg.show_viewport()
|
||||
dpg.start_dearpygui()
|
||||
finally:
|
||||
dpg.destroy_context()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user