Skip to content

Parent could not be deduced #1581

Answered by vyrjana
gsal asked this question in Support
Jan 31, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

The problem is that you are calling dpg.window() instead of dpg.add_window(). If you check the type of the value returned by each of those functions, then you would see that the former returns something like <contextlib._GeneratorContextManager object at 0x7f5cda637910> whereas the latter returns an integer (i.e. the ID that you are looking for).

So you could just switch over to dpg.add_window(). If you absolutely wanted to use dpg.window(), then you could do something like:

def new_doc_callback():
    doc = Document()
    with dpg.window(label="New doc", width=800, height=600) as window:
        doc.win = window
        dpg.add_button(label="New Figure", callback=new_figure_callback, use…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gsal
Comment options

Answer selected by gsal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
2 participants