Skip to content

Question: How to pass events across controls? #1863

@buliangshuai0013

Description

@buliangshuai0013
Image

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions