def show_logger() -> None: """Shows the logger window Returns: None """ internal_dpg.show_logger()
def main(): parser = argparse.ArgumentParser( description="Winsnap: Snap windows into a customizable grid") parser.add_argument("--debug", action="store_true", help="Show the log window") args = parser.parse_args() main_window = MainWindow() def mouse_click_cb(sender, data): main_window.refresh_windows() def startup_cb(sender, data): main_window.load() dpg_core.set_mouse_click_callback(mouse_click_cb) dpg_core.set_start_callback(startup_cb) dpg_core.set_resize_callback(main_window.resize_callback, handler="Main Window") scale = ctypes.windll.shcore.GetScaleFactorForDevice(0) / 100 dpg_core.set_global_font_scale(scale) w, h = dpg_core.get_main_window_size() dpg_core.set_main_window_size(int(w * scale), int(h * scale)) dpg_core.set_main_window_title("WinSnap") if args.debug: dpg_core.show_logger() dpg_core.start_dearpygui(primary_window="Main Window")
def start_development_windows(logger: str): """ Starts doc, debug, and logger window """ add_doc_window(name="Core Documentation", x_pos=0, y_pos=800) end() show_logger() # for some reason the default logger doesn't show the first # log_info call so this clears that out. log_info("Clearing out initial issue with logger", logger=logger) add_debug_window(name="Debug", x_pos=0, y_pos=300) end()
def example_two(): """ Commands to put into input """ with s.window("Hello World", autosize=True): c.add_text("Hello world!") c.show_logger() c.log_info("Foo") c.log_info("Check it out ma - no IDE!") with s.window("Canvas", x_pos=0, y_pos=300, autosize=True): c.add_drawing("Draw", width=300, height=300) c.draw_circle( "Draw", center=[150, 150], radius=50, color=[125, 125, 125], fill=[125, 125, 200], )
dpg.log_debug("start") thread_floaty = threading.Thread(target=produce_frame, args=()) thread_floaty.setDaemon(True) thread_floaty.start() print(id(thread_floaty)) else: print(id(thread_floaty)) running=False thread_floaty.join() dpg.log_debug("stop") thread_floaty = None with sdpg.window(): dpg.add_drawing('drawing', width=1000, height=800) dpg.add_text("tooltipTest") with sdpg.window("Main Window"): # dpg.set_main_window_size(1400, 800) dpg.set_main_window_title("Pixel selector") # dpg.add_ dpg.add_button("camera##1", callback=camera_frame_control, tip="this will not a freeze the GUI") dpg.show_logger() do.show_demo () dpg.start_dearpygui()
def retrieve_log(sender, callback): core.show_logger() for element in motor_count: core.log_info(core.get_value(f"motor {element}##inputtext"))