Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_xxx raise exceptions even if the alias not exists anymore #1392

Closed
nocodo189753 opened this issue Nov 2, 2021 · 1 comment
Closed

add_xxx raise exceptions even if the alias not exists anymore #1392

nocodo189753 opened this issue Nov 2, 2021 · 1 comment
Labels
state: duplicate This issue or pull request already exists

Comments

@nocodo189753
Copy link

Version of Dear PyGui

Version: 1.0.2
Operating System: Windows 10

My Issue/Question

I add some debug code to print all item in system, it seems the old item already deleted, but exception still raised when add the new item with the same alias

To Reproduce

see code below

Expected behavior

no exceptions

Screenshots/Video

Standalone, minimal, complete and verifiable example

import dearpygui.dearpygui as dpg
import random

dpg.create_context()
dpg.create_viewport(title='Custom Title', width=300, height=600)

def print_items(tag):
    print('-----', tag)
    for i in dpg.get_all_items():
        print(i, dpg.get_item_alias(i))
    print('-----')

def btn_cb(s, a, u):
    dpg.delete_item('win2', children_only = True)
    print_items(1)
    try:
        dpg.add_input_text(label = 'input', default_value = f'data{random.randint(0,10)}', tag = 'input_id', parent = 'win2')
    except Exception as e:
        print('Error:', e)
    print_items(2)

with dpg.window(label = 'win'):
    with dpg.child_window(tag = 'win1', width = 300, height = 200):
        dpg.add_button(label = 'update', callback = btn_cb)
    with dpg.child_window(tag = 'win2', width = 300, height = 200):
        pass

dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
@nocodo189753 nocodo189753 added state: pending not addressed yet type: bug bug labels Nov 2, 2021
@hoffstadt
Copy link
Owner

I believe this is related to this issue.

@hoffstadt hoffstadt added state: duplicate This issue or pull request already exists and removed type: bug bug state: pending not addressed yet labels Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants