You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

View VID点击图片无法触发动作(Windows正常,macOS异常)

Red语言macOS下Image组件on-down事件无响应问题

环境信息

  • macOS El Capitan
  • 2008年末款MacBook
  • red-view版本:19mar25-6942c7a02

问题现象

运行测试代码时,鼠标左键点击image组件完全无响应,仅base组件能触发on-down事件,无任何报错信息。相同代码在Windows环境下可正常运行,所有组件的点击事件均能触发。

复现代码

Red [ about: "on-down with image" ]

; image created with DRAW
pacman: draw 100x100 [
    anti-alias off
    pen black fill-pen black box 0x0 100x100 
    line-width 10
    pen yellow fill-pen yellow circle 50x50 35 
    pen black fill-pen black triangle 50x50 100x0 100x100
]


; only base reacts to mouse left click
view layout [
    title "On-down with image"
    below
    text "base"
    base pacman on-down [ print "base click"] 
    text "image with on-down"
    image pacman on-down [ print "image click"] 
    text "image and block"
    image pacman [ print "image click"]
]

排查细节

为定位问题,新增测试代码输出组件内部配置信息:

Red [ about: "on-down with image" ]


square: draw 50x50 [ pen red fill-pen red box 0x0 50x50]


; only base reacts to mouse left click
view layout [
    text "click the red square (no effect)"
    a: image square on-down [ print "image on-down"] 

    b: base on-down [ print "base on-down"]

    return

    button "click to print informations" [
    print "image actors ..."
    probe a/actors 
    print "base actors ..."
    probe b/actors
    ?? system/view/vid/styles/image]
]

经对比,macOS与Windows环境下输出的组件actors信息、system/view/vid/styles/image定义完全一致,排除组件配置差异问题。


内容的提问来源于stack exchange,提问作者felix

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.11 18:04:54