[REBOL] Re: Forms with separate context
From: gscottjones:mchsi at: 15-Dec-2002 16:53
From: "Davide Gessi"
> After this example I understood that the context of "titolo" isn't the
> object chat, but it's the global context, and I have only one var
> Now my big question is: what is the best method to have a collection of
> similar form, with separate context for each of them ?
> But I would investigate if a better method exists.
> Hope my question is clear, my english is poor :(
I don't know if I can provide the *best* method, but here is one that
demonstrates several little tricks that may help:
chatters: copy 
chat: make object! [
nome: copy ""
(to-set-word join 'titolo nome) h2 (join "Chatting with: " nome)
show: does [
view/new frm-chat: layout compose frm
append chatters to-word join 'titolo nome
chatters: unique chatters
chat1: make chat [
chat2: make chat [
view layout [
button "Show Davide" [chat1/show]
button "Show Luca" [chat2/show]
button "Print values" [
foreach chatter chatters [
print get in do chatter 'text
Hope that helps.