How to get a values in outputs node? #1967
Unanswered
MrYassinox
asked this question in
Support
Replies: 1 comment
-
|
The quick way and I think the only way off the top of my head is to give nodes a name. So something like this what I put below, I really wish there was a better way. (I could also be completely wrong and there is a better way) import dearpygui.dearpygui as dpg
dpg.create_context()
dpg.create_viewport(title='Nodes', width=600, height=300)
def onlink(sender:int|str, data:list[str|int]) -> None:
...
def ondelink(sender:int|str, data:list[str|int]) -> None:
...
with dpg.window(label="Example Window"):
with dpg.node_editor(label="Simple node editor", callback=onlink, delink_callback=ondelink) as node_editor:
...
with dpg.node(label="TestOutput"):
with dpg.node_attribute(tag="SomeOutput", attribute_type=dpg.mvNode_Attr_Output):
dpg.add_input_text(default_value="hello", tag="SomeOutput:value")
with dpg.node(label="TestInput"):
with dpg.node_attribute(tag="SomeInput", attribute_type=dpg.mvNode_Attr_Input):
dpg.add_text("", tag="SomeInput:value")
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question #1:
I want to give the node attribute a value and access it in other node when i connect it
but how ?
Question #2:
How to get a values in outputs node?
Please help me any example 🙏
Beta Was this translation helpful? Give feedback.
All reactions