You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While bind_item_handler_registry tests whether each handler can be bound to the target widget, it does that in a weird way: for some handlers this test doesn't work. This makes it possible to bind handlers that are not applicable, or sometimes makes it impossible to bind a handler that the widget actually does support.
dpg.table_row() only supports the 'visible' handler, but DPG has no objections when one of those handlers above is bound to the row.
dpg.add_node_link() supports the hover handler, but DPG won't allow to bind it. On a side note, binding any handler to add_node_link() will lead to a segfault due to another bug; that bug will go in a separate ticket.
To Reproduce
Steps to reproduce the behavior:
Run the first example.
The code must fail with an exception saying a handler is not applicable. If it doesn't fail, then all handlers have been bound to the table row row, even though it doesn't support any of them.
Run the second example.
The code is expected to fail with exactly one exception, which it will catch and print, prepended with "Expected failure". This is because it attempts to bind a deactivated_handler, which node_link does not support. If there's no such message, then DPG allowed deactivated_handler to be bound, though it should not.
It might then segfault due to a bug in node_link.
If the code prints "Unexpected failure" and an exception, then it was unable to bind the hover handler, even though it's supported by node_link.
Expected behavior
Handlers having "xxx_handler_applicable": True in get_item_info must get bound without any issues.
Handlers having "xxx_handler_applicable": False must cause bind_item_handler_registry to fail.
Screenshots/Video
None.
Standalone, minimal, complete and verifiable example
Example 1: binding unsupported handlers to a table row.
v-ein
changed the title
bind_item_handler_registry tests for handlers applicability incorrectly
bind_item_handler_registry tests for handler applicability incorrectly
Oct 4, 2023
Version of Dear PyGui
Version: 1.9.1
Operating System: Windows 10
My Issue/Question
While
bind_item_handler_registry
tests whether each handler can be bound to the target widget, it does that in a weird way: for some handlers this test doesn't work. This makes it possible to bind handlers that are not applicable, or sometimes makes it impossible to bind a handler that the widget actually does support.The handlers affected are:
Here are a couple of examples:
dpg.table_row()
only supports the 'visible' handler, but DPG has no objections when one of those handlers above is bound to the row.dpg.add_node_link()
supports the hover handler, but DPG won't allow to bind it. On a side note, binding any handler toadd_node_link()
will lead to a segfault due to another bug; that bug will go in a separate ticket.To Reproduce
Steps to reproduce the behavior:
row
, even though it doesn't support any of them.Expected behavior
Handlers having
"xxx_handler_applicable": True
inget_item_info
must get bound without any issues.Handlers having
"xxx_handler_applicable": False
must causebind_item_handler_registry
to fail.Screenshots/Video
None.
Standalone, minimal, complete and verifiable example
Example 1: binding unsupported handlers to a table row.
Example 2: binding supported and unsupported handlers to a node link.
The text was updated successfully, but these errors were encountered: