forked from hoffstadt/DearPyGui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
52 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
|
||
import dearpygui.dearpygui as dpg | ||
import time | ||
import dearpygui.demo as demo | ||
from dearpygui_ext.logger import mvLogger | ||
|
||
dpg.create_context() | ||
#dpg.configure_app(manual_callback_management=True) | ||
dpg.create_viewport() | ||
dpg.setup_dearpygui() | ||
|
||
i = 0 | ||
|
||
def resize_viewport_callback(): | ||
dpg.set_value("ViewportWidthText", f"Viewport Width: {dpg.get_viewport_width()}") | ||
dpg.set_value("ViewportHeightText", f"Viewport Height: {dpg.get_viewport_height()}") | ||
dpg.set_value("LastViewportSizeUpdateText", f"Time: {time.time_ns()}") | ||
global i | ||
print(i) | ||
i+=1 | ||
log = mvLogger() | ||
log.log("log") | ||
log.log_debug("log debug") | ||
log.log_info("log info") | ||
log.log_warning("log warning") | ||
log.log_error("log error") | ||
log.log_critical("log critical") | ||
|
||
dpg.set_viewport_resize_callback(resize_viewport_callback) | ||
with dpg.font_registry(): | ||
with dpg.font("../../assets/NotoSerifCJKjp-Medium.otf", 20, tag="custom font"): | ||
dpg.add_font_range_hint(dpg.mvFontRangeHint_Default) | ||
dpg.bind_font(dpg.last_container()) | ||
|
||
with dpg.window(label="Example Window", tag="Window"): | ||
dpg.add_text("Viewport Width: ", tag="ViewportWidthText") | ||
dpg.add_text("Viewport Height: ", tag="ViewportHeightText") | ||
dpg.add_text("Time: ", tag="LastViewportSizeUpdateText") | ||
|
||
dpg.set_primary_window("Window", True) | ||
demo.show_demo() | ||
|
||
# main loop | ||
dpg.show_viewport() | ||
dpg.start_dearpygui() | ||
while dpg.is_dearpygui_running(): | ||
#dpg.run_callbacks(dpg.get_callback_queue()) | ||
dpg.render_dearpygui_frame() | ||
|
||
dpg.destroy_context() |