1

REBOL 我目前正在尝试重做我在 Delphi 中制作的一个小应用程序。此应用程序在 n 中显示背景图像,在 n 中显示文本,但我无法更改图像或文本,图像和文本的更改是通过按钮 >> 完成的。

这是没有随机部分的简化代码,因为我发现了它:

Rebol[
Title: "You have a message !"
Version: 1.0.0
Needs: [1.2.115]
]

the-imag1: load %"/C/MyFile/Cours CD/Affiche/Images/Vague9.jpg"
the-imag2: load %"/C/MyFile/Cours CD/Affiche/Images/Vague3.jpg"
the-image: the-imag1
text1: "Your banner text here" 

view xx1: layout [
size the-image/size
b1: backdrop the-image

at b1/offset + 110x120
box  350x150 font-size 20 font-color black [align: 'center] text1

    at b1/offset + 530x370
    btn ">>" [the-image: the-imag2 ; new image
              text1: "Hello"       ; new text
               show xx1] effect [multiply 90]
]
4

1 回答 1

1

您正在重新定义面孔,而不仅仅是内容。只需重新定义您需要的字段。试试这个:

Rebol[
    Title: "You have a message !"
    Version: 1.0.0
    Needs: [1.2.115]
]

the-imag1: load %"/C/MyFile/Cours CD/Affiche/Images/Vague9.jpg"
the-imag2: load %"/C/MyFile/Cours CD/Affiche/Images/Vague3.jpg"
the-image: the-imag1
text1: "Your banner text here" 

view xx1: layout [
size the-image/size
b1: backdrop the-image

at b1/offset + 110x120
t1: text text1

    at b1/offset + 530x370
    btn ">>" [
        b1/image: the-imag2       ; new image
        t1/text: "Hello"       ; new text
        show xx1
    ] effect [multiply 90]
]
于 2013-03-15T12:40:39.183 回答