跳到内容

Rebol 编程/focus

来自维基教科书,开放世界中的开放书籍
FOCUS face /no-show 

将关键事件集中在特定界面上。

FOCUS 是一个函数值。

  • face -- (类型: 任何)
  • /no-show

源代码

[编辑 | 编辑源代码]
focus: func [
    "Focuses key events on a specific face." 
    face 
    /no-show 
    /local tmp-face
][
    unfocus 
    if not face [exit] 
    focal-face: face 
    if not string? face/text [
        face/text: either face/text [form face/text] [copy ""] 
        face/line-list: none
    ] 
    if not caret [caret: tail face/text] 
    if none? face/line-list [
        if face/para [face/para/scroll: 0x0] 
        caret: tail face/text
    ] 
    if flag-face? face field [hilight-all face] 
    if not no-show [show face]
]
华夏公益教科书