Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[ALLY] Text in and out of an area Re:

 [1/7] from: larry:ecotope at: 13-Sep-2000 19:55


Hi Greg This should get you started. At the View console:
>> s: {This is some text to be edited.
{ This is the second paragraph.} == {This is some text to be edited. This is the second paragraph.}
>> view layout [ar: area 100x100 para [wrap?: on] do [ar/text: s] button
save [s: ar/text]] The edit window opens. I added a new 3rd paragraph, then closed the window which returns to the console.
>> print s
This is some text to be edited. This the second paragraph. This is the third paragraph.
>>
Cheers -Larry

 [2/7] from: larry:ecotope at: 13-Sep-2000 20:12


Hi Allen Very nice. Cheers -Larry

 [3/7] from: gregco:pressroom at: 13-Sep-2000 22:00


I haven't been able to come up with a way to send a string of text to a view area for editing and then retrieve it for further processing. In other words, I want to: 1. Create a face with a text area. 2.Create a string of text programmatically. 3. Send that text string to the area for manual editing. 4. Retrieve the edited text for further program manipulation. No doubt there is a simple answer to this, but I haven't found it in the docs or by trial and error. Any ideas? Greg Coughlan

 [4/7] from: larry:ecotope at: 14-Sep-2000 10:41


Hi Greg ----- Original Message ----- From: <[gregco--pressroom--com]> To: <[ally--rebol--com]> Sent: Thursday, September 14, 2000 9:47 AM Subject: [ALLY] Text in and out of an area Re:(2)
> Thanks Larry, this is just about what I was looking for, though Allen K's > demos have got me rethinking some of what I'm trying to do.
You are welcome.
> Your example clears up some of the confusion I have about the "nesting" of > view blocks, objects and parameters. Looks like studying examples is
going
> to be much more helpful than the docs at this point > > I tryed some things pretty close to what you did, but not quite. (;-)> > > I would not have thought you needed the "do" to evaluate the "[ar/text: > s]" -- but your way works. ( as opposed to just "ar/text:s" without
putting
> it in a block.)
Pardon. My ugly. You *don't* need the do [code-block]. I was just in a hurry and knew that using do would work for sure. But in fact you can just intersperse REBOL code in the layout as long as it evaluates to a legal argument for the layout keyword, as Allen's example shows.
> Thanks, > > Greg Coughlan >
Cheers -Larry

 [5/7] from: gregco:pressroom at: 14-Sep-2000 12:31


Thanks Allen, this is very helpful. I don't recall seeing the "inform" command documented any where. I assume it grnerates the popup, right? Greg

 [6/7] from: gregco:pressroom at: 14-Sep-2000 12:47


Thanks Larry, this is just about what I was looking for, though Allen K's demos have got me rethinking some of what I'm trying to do. Your example clears up some of the confusion I have about the "nesting" of view blocks, objects and parameters. Looks like studying examples is going to be much more helpful than the docs at this point I tryed some things pretty close to what you did, but not quite. (;-)> I would not have thought you needed the "do" to evaluate the "[ar/text: s]" -- but your way works. ( as opposed to just "ar/text:s" without putting it in a block.) Thanks, Greg Coughlan

 [7/7] from: allenk:powerup:au at: 14-Sep-2000 12:51


----- Original Message ----- From: <[gregco--pressroom--com]> To: <[ally--rebol--com]> Sent: Thursday, September 14, 2000 12:00 PM Subject: [ALLY] Text in and out of an area
> I haven't been able to come up with a way to send a string of text to a
view
> area for editing and then retrieve it for further processing. > In other words, I want to:
<<quoted lines omitted: 6>>
> Any ideas? > Greg Coughlan
Hi Greg, I think these demos might help. Needs xper 0.10.33. (execution in the main script is halted until the popup is closed.) Cheers, Allen K REBOL [] edit-text: func [data [string!]][ inform layout [text-area: area copy data button "Close" [hide-popup]] text-area/text ] ; demo1 running from script (with no initial view window) old-string: copy "Demo1 string" new-string: edit-text old-string print ["Old-String - " old-string "^/" "New-String - " new-string] ; demo2 ; running from another view window old-string: copy "Demo 2 string" view layout [button "click" [ new-string: edit-text old-string print ["Old-String - " old-string "^/" "New-String - " new-string] ] ] halt

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted