step 3: add widget shell and renderer foundation
This commit is contained in:
25
examples/basic_digital.py
Normal file
25
examples/basic_digital.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# pyright: reportGeneralTypeIssues=false
|
||||
|
||||
import dearpygui.dearpygui as dpg
|
||||
|
||||
import dpg_gauges as dpgg
|
||||
|
||||
|
||||
def main() -> None:
|
||||
dpg.create_context()
|
||||
try:
|
||||
with dpg.window(label="Digital Gauge", width=320, height=180):
|
||||
dpgg.digital_gauge(
|
||||
tag="speed", label="Speed", value=72, unit="km/h", width=260, height=100
|
||||
)
|
||||
|
||||
dpg.create_viewport(title="dpg-gauges digital", width=360, 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