[REBOL] Re: View and objects?
From: carl:cybercraft at: 5-Oct-2002 10:05
Hi Gilles,
On 04-Oct-02, g wrote:
> I have a probleme with view.
> if i make an object including a layout:
> Essai: make object! [ lay: layout [ text: field "" ]]
Using 'text as a word for the field there isn't a good idea as layouts
already use text.
> Essai1: make Essai
That should be...
Essai1: make Essai []
> when i use
> view/new Essai/lay
> and
> view/new Essai1/lay
> view/new does not display a new windows, and if i try to find a way
> to do so, the values of the two text field are the same even if they
> are not part of the sa=E9e object. How can I go around this problem??
Use copy on the string in the layout. However, as you've found out,
making a copy of Essai like that doesn't make a copy of the layout
within the object. The following might be a suitable way around this
for you, depending on what you're trying to do...
lo: [ txt: field copy "" ]
Essai: make object! [ lay: layout lo]
Essai1: make Essai [ lay: layout lo]
view layout [
button "Essai" [view/new Essai/lay]
button "Essai 1" [view/new Essai1/lay]
]
HTH.
--
Carl Read