How to pass events across controls? #1883
buliangshuai0013
started this conversation in
General
Replies: 1 comment
-
|
gpui 提供了类似全局state的东西 a使用update b使用subscribe 就能获取到了 |
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.
-
GPUI怎么跨控件传递事件。让另一控件接收事件响应。由于view_a,和view_b都有一层包裹。比如作为dock的child。怎么让btn按钮点击,element_c跟着响应。
1 由于都有一层包裹:mainwindow 不能直接访问view_a和view_b,导致emit subscribe使用不方便。
2 我尝试用windows.dispatch_action也接收不到消息。
GPUI有没有好的方法能够实现?
How to pass events across controls in GPUI and have another control receive and respond to the event. Since both view_a and view_b are wrapped (e.g., as children of a dock), how can we make the btn button click and have element_c respond accordingly?
Due to both being wrapped: mainwindow cannot directly access view_a and view_b, making it inconvenient to use emit and subscribe.
I've tried using windows.dispatch_action but still can't receive the message.
Does GPUI have a good way to achieve this?
Beta Was this translation helpful? Give feedback.
All reactions