Closed west-rynes closed 2 years ago
As a Workaround till it is fixed:
import dearpygui.dearpygui as dpg
import dearpygui
import platform
print(f"DPG Version: {dearpygui.__version__}")
print(f"OS: {platform.platform()}")
dpg.create_context()
dpg.configure_app(
wait_for_input=False, # Can set to true but items may not live update. Lowers CPU usage
init_file="temp.ini",
docking=True,
docking_space=True
)
def exit_callback():
print("Exit called...")
dpg.save_init_file("temp.ini")
with dpg.window(on_close=lambda sender, data: exit_callback) as main_window:
dpg.add_text("Hello")
dpg.create_viewport()
dpg.setup_dearpygui()
dpg.set_primary_window(main_window, True)
dpg.show_viewport()
#dpg.set_exit_callback(exit_callback)
dpg.start_dearpygui()
dpg.destroy_context()
Fixed in next release.
Still has segmentation fault: DPG Version: 1.10.0
Version of Dear PyGui
DPG Version: 1.1.1 OS: macOS-10.15.7-x86_64-i386-64bit
My Issue/Question
Would be nice to be able to save the ini files using the exit callback. But it seems everything has exited. Seems like the utility of
set_exit_callback
is currently broken.I think this is related to #1390
Standalone, minimal, complete and verifiable example
Output