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

How to put return in view facets

 [1/5] from: semseddinm:bircom at: 21-Jan-2009 16:26


Hi, I'm using View 2.7.6, how do I put a return (newline) char in a label, vtext etc.? REBOL [] view layout [label "test1^/test2"] ^/ doesn't mean new line?

 [2/5] from: anton:wilddsl:au at: 22-Jan-2009 1:57


Hi, Yes, ^/ is a newline character, as you can see: newline ;== #"^/" You can use AS-IS to prevent the LABEL init from trimming the text of line breaks and extra spaces. eg. view layout [label as-is "line-1^/line-2"] So the line breaks now appear as expected. You can see where the trimming happens here: print mold svv/vid-styles/label/init Other text styles are affected by AS-IS in exactly the same way. They are (probably) all found and listed by this code: foreach [style face] svv/vid-styles [ if find mold face/init "as-is" [print style] ] Regards, Anton. =DEemseddin Moldibi [ Bircom ] wrote:

 [3/5] from: semseddinm::bircom::com at: 21-Jan-2009 17:24


Wow! That is great! Thank you so much. I didn't know about "as-is" flag. Is it undocumented?

 [4/5] from: brock::kalef::innovapost::com at: 21-Jan-2009 9:54


You can control the size of the label to get the desired affect.... REBOL [] view layout [label 40x40 "test1 test2"] By providing a multi-row label area as above, the wrap occurs automatically. I realize this is likely not a representation of the data you are trying to apply this to. I also find myself unable to 'rejoin 'reduce 'form 'mold or 'compose a string to get the desired textual result, which surprises me.

 [5/5] from: semseddinm::bircom::com at: 22-Jan-2009 12:23


Hi, Anton Rolls answered this issue very well, "as-is" flag solves the problem for many facets, label, info, field etc. view layout [label as-is "line-1^/line-2"] we cannot change the label size usually because width should be fixed many times.