step 3: add widget shell and renderer foundation
This commit is contained in:
25
examples/sizing.py
Normal file
25
examples/sizing.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="Sizing", width=520, height=300):
|
||||
dpgg.digital_gauge(tag="fixed", label="Fixed", value=12.3, width=180, height=80)
|
||||
dpgg.digital_gauge(tag="wide", label="Fill width", value=45.6, width=-1, height=80)
|
||||
dpgg.analog_gauge(tag="square", label="Square", value=60, width=180, height=180)
|
||||
|
||||
dpg.create_viewport(title="dpg-gauges sizing", width=560, height=340)
|
||||
dpg.setup_dearpygui()
|
||||
dpg.show_viewport()
|
||||
dpg.start_dearpygui()
|
||||
finally:
|
||||
dpg.destroy_context()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user