step 5: complete first gauge catalogue
This commit is contained in:
32
examples/basic_thermometer.py
Normal file
32
examples/basic_thermometer.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# pyright: reportGeneralTypeIssues=false
|
||||
|
||||
import dearpygui.dearpygui as dpg
|
||||
|
||||
import dpg_gauges as dpgg
|
||||
|
||||
|
||||
def main() -> None:
|
||||
dpg.create_context()
|
||||
try:
|
||||
with dpg.window(label="Thermometer Gauge", width=280, height=340):
|
||||
dpgg.thermometer_gauge(
|
||||
tag="coolant",
|
||||
label="Coolant",
|
||||
value=92,
|
||||
min_value=40,
|
||||
max_value=120,
|
||||
unit="C",
|
||||
width=180,
|
||||
height=260,
|
||||
)
|
||||
|
||||
dpg.create_viewport(title="dpg-gauges thermometer", width=320, height=380)
|
||||
dpg.setup_dearpygui()
|
||||
dpg.show_viewport()
|
||||
dpg.start_dearpygui()
|
||||
finally:
|
||||
dpg.destroy_context()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user