tareksander / termux-gui-c-bindings

A C/C++ library to interact with the Termux:GUI plugin
Mozilla Public License 2.0
19 stars 7 forks source link

Nothing happens after click on ImageView #14

Closed rsuu closed 8 months ago

rsuu commented 8 months ago

But it works on Button.

tareksander commented 8 months ago

Have you enabled click events on the ImageView? They are automatically enabled for Buttons, as that is the expected use case for Buttons.

rsuu commented 8 months ago

If you mean SetClickableRequest, yes

And here is the log

[examples/img.rs:14] &img_view = WrapView {
    req: CreateImageViewRequest {
        data: Some(
            Create {
                aid: 0,
                parent: -1,
                v: Visible,
            },
        ),
        keyboard: false,
    },
    res: Some(
        CreateImageViewResponse {
            id: 610336268,
            code: Ok,
        },
    ),
}
[examples/img.rs:15] &iv = Some(
    View {
        aid: 0,
        id: 610336268,
    },
)
[examples/img.rs:16] &clickable = SetClickableResponse {
    success: true,
    code: Ok,
}
[examples/img.rs:43] "start" = "start"
[examples/img.rs:48] res = InterceptVolumeButtonResponse {
    success: true,
    code: Ok,
}
[examples/img.rs:52] res = InterceptBackButtonResponse {
    success: true,
    code: Ok,
}
[examples/img.rs:38] "Back" = "Back"
tareksander commented 8 months ago

I meant SendClickEventRequest. SetClickableRequest is for enabling click feedback for the user, such as an auditory click.

rsuu commented 8 months ago

It works pretty well, Thank you :)