dearpygui.dearpygui.window tag parameter must be > 0
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 45/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- python
- Domain
- documentation
Research direction
Start at the linked Dear PyGui reference documentation page and locate the window tag parameter description. Update it to state that integer tags must be greater than 0, then verify that the rendered documentation shows the revised wording.
Written by the indexing model from the issue text.
Description
The current documentation for window has the following for the tag parameter:
tag (Union[int, str], optional) – Unique id used to programmatically refer to the item.If label is unused this will be the label.
https://dearpygui.readthedocs.io/en/latest/reference/dearpygui.html#dearpygui.dearpygui.window
My Improvement
tag (Union[int, str], optional) – Unique id used to programmatically refer to the item. If label is unused this will be the label. If using an integer, it must be greater than 0.
Necessary Assets
The following code works as expected.
import dearpygui.dearpygui as dpg
dpg.create_context()
with dpg.window(tag=1):
dpg.add_text("Hello, world")
dpg.add_button(label="Save")
dpg.add_input_text(label="string", default_value="Quick brown fox")
dpg.add_slider_float(label="float", default_value=0.273, max_value=1)
dpg.create_viewport(title='Custom Title', width=600, height=200)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.set_primary_window(1, True)
dpg.start_dearpygui()
dpg.destroy_context()
Setting tag to -1 will result in the following error:
OverflowError: can't convert negative int to unsigned
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/alex/py313/lib/python3.13/site-packages/dearpygui/dearpygui.py", line 2969, in window
widget = internal_dpg.add_window(label=label, user_data=user_data, use_internal_label=use_internal_label, tag=tag, width=width, height=height, indent=indent, show=show, pos=pos, delay_search=delay_search, min_size=min_size, max_size=max_size, menubar=menubar, collapsed=collapsed, autosize=autosize, no_resize=no_resize, unsaved_document=unsaved_document, no_title_bar=no_title_bar, no_move=no_move, no_scrollbar=no_scrollbar, no_collapse=no_collapse, horizontal_scrollbar=horizontal_scrollbar, no_focus_on_appearing=no_focus_on_appearing, no_bring_to_front_on_focus=no_bring_to_front_on_focus, no_close=no_close, no_background=no_background, modal=modal, popup=popup, no_saved_settings=no_saved_settings, no_open_over_existing_popup=no_open_over_existing_popup, no_scroll_with_mouse=no_scroll_with_mouse, on_close=on_close, **kwargs)
SystemError: <built-in function add_window> returned a result with an exception set
During handling of the above exception, another exception occurred:
Exception: Error: [1009] Message: No container to pop.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/alex/source/gui-test/test.py", line 5, in <module>
with dpg.window(tag=-1):
~~~~~~~~~~^^^^^^^^
File "/usr/lib/python3.13/contextlib.py", line 141, in __enter__
return next(self.gen)
File "/home/alex/py313/lib/python3.13/site-packages/dearpygui/dearpygui.py", line 2973, in window
internal_dpg.pop_container_stack()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
SystemError: <built-in function pop_container_stack> returned a result with an exception set
Setting tag to 0 will result in the following error:
Exception:
Error: [1005]
Command: set_primary_window
Item: 0
Label: Not found
Item Type: Unknown
Message: Item not found: 0
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/alex/source/gui-test/test.py", line 14, in <module>
dpg.set_primary_window(0, True)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/home/alex/py313/lib/python3.13/site-packages/dearpygui/dearpygui.py", line 9523, in set_primary_window
return internal_dpg.set_primary_window(window, value, **kwargs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
SystemError: <built-in function set_primary_window> returned a result with an exception set
- Dominant language
- C++
- Stars
- 15.7k
- Forks
- 790
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hoffstadt/DearPyGui
-
Plot series data silently truncated to float32 when passed as numpy array (should be float64/double)Openstate: pending type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
state: pending type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
state: pending type: improvement
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
state: pending type: bug
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
state: pending type: improvement
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in hoffstadt/DearPyGui
Similar issues
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPossibly taken @lijy91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
bot-triaged module: correctness (silent) module: fft triage review
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
patrickjquinn/Marathon-Shell#84 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
Maintainers usually reply within 1 day