开发者

How to probe rebol layout but just get original spec

开发者 https://www.devze.com 2023-03-15 15:12 出处:网络
Let开发者_运维技巧\'s take: panel1: layout [ origin 8x8 h2 \"Panel 1\" field \"Field 1\" field \"Field 2\"

Let开发者_运维技巧's take:

panel1: layout [
    origin 8x8
    h2 "Panel 1"
    field "Field 1"
    field "Field 2"
    button "The Answer" [alert "I know nothing."]
]

If I probe panel1 I got a bunch of lines whereas I'd like to get just the original block:

[
        origin 8x8
        h2 "Panel 1"
        field "Field 1"
        field "Field 2"
        button "The Answer" [alert "I know nothing."]
    ]

How to get just this ?


You should simply use another word to hold the block value:

panel1: layout panel-def: [
    origin 8x8
    h2 "Panel 1"
    field "Field 1"
    field "Field 2"
    button "The Answer" [alert "I know nothing."]
]

probe panel-def

Because layout function returns a face object with lots of default values. By the way use ? instead of probe because there can be self references in face objects so you'll have a endless probe output.

0

精彩评论

暂无评论...
验证码 换一张
取 消