World: r3wp
[View] discuss view related issues
older newer | first last |
amacleod 22-Aug-2007 [7139] | I've been using list-view with mysql-protocol for a while but the method I use to move data back and forth between mysql data and the list-view is not very elegant. Are there any examples of how object lists..mysql views work with list-view? |
Henrik 22-Aug-2007 [7140] | object lists are not suited for mysql results. just use plain blocks in blocks, returned from the database. that works fine. |
amacleod 28-Aug-2007 [7141x2] | hI'm trying to append to a face for export to a .png later. I'm able to append some text using something like: append gui [at 264x72 text "SOME TEXT" bold font-size 20] |
That works fine, however, when I try to step through a block of data to be appended usinf FOREACH I only end up with the last item of data appended. Previously appended text remains but any text I attemt to append in the FOREACH loop does not "Stick". Any ideas? | |
Henrik 28-Aug-2007 [7143] | source example? |
amacleod 28-Aug-2007 [7144x4] | data: [ ["3/20/1965" "75 Pond Place" "Babylon" "NY" "11702" "Soleiman" "Single Family" "Standard" "Form" "Richaard Soleiman"] ["5/20/1965" "22-75 Pond Place" "Babylon" "NY" "11702" "Soleiman" "Single Family" "Standard" "Form" "Richaard Soleiman"] ["6/20/1965" "75 Pond Place" "Babylon" "NY" "11702" "Soleiman" "Single Family" "Standard" "Form" "Richaard Soleiman"] ["7/20/1965" "875 Pond Place" "Babylon" "NY" "11702" "Soleiman" "Single Family" "Standard" "Form" "Richaard Soleiman"] ["8/20/1965" "175 Pond Place" "Babylon" "NY" "11702" "Soleiman" "Single Family" "Standard" "Form" "Richaard Soleiman"] ["9/20/2007" "80 Pond Place" "Babylon" "NY" "11702" "Soleiman" "Single Family" "Standard" "Form" "Richaard Soleiman"] ["10/20/1965" "75 Pond Place" "Babylon" "NY" "11702" "Soleiman" "Single Family" "Standard" "Form" "Richaard Soleiman"] gui: [ pic: image picture ] coorx: [73 203 440 555 700 790 920] coory: [281 346 410 472 536 603 662] y: 215 append gui [at 264x72 text "Some Text" bold font-size 20] foreach dat data [ append gui [ at to-pair reduce [80 y] text reduce bold font-size 15 dat/1 at to-pair reduce [215 y] text reduce bold font-size 15 dat/2 at to-pair reduce [215 y + 15] text bold font-size 15 reform [dat/3 ", " dat/4 " " dat/5] at to-pair reduce [452 y] text reduce bold font-size 15 dat/6 at to-pair reduce [567 y] text reduce bold font-size 15 dat/7 at to-pair reduce [712 y] text reduce bold font-size 15 dat/8 at to-pair reduce [802 y] text reduce bold font-size 15 dat/9 at to-pair reduce [935 y] text reduce bold font-size 15 dat/10 ] y: y + 65 ] append gui [at 264x200 text "Some more text" bold font-size 20] view layout gui |
SOME TEXT and "SOME MORE TEXT" will appemd to picture but I only get the last data block appended. | |
I've stepped trhrough with a view layout after each FOREACH and I see that each data block is appended but disappears on the next loop | |
forget that coorx and coory stuff. I ment to remove that | |
Henrik 28-Aug-2007 [7148x2] | you are appending a non-reduced block to 'gui. that could be the problem. |
in the loop | |
amacleod 28-Aug-2007 [7150x2] | I'm not sure. |
Do I need to some how save "gui" face inside the loop? | |
Henrik 28-Aug-2007 [7152x3] | well, the block inside the loop is not reduced, which means that all positions and texts are not really being put into the 'gui block. |
just before 'view'ing the block, try: probe gui | |
>> a: "some text" == "some text" >> b: [] == [] >> append b [a] == [a] >> append b reduce [a] == [a "some text"] | |
amacleod 28-Aug-2007 [7155] | I se the problem...The append statements are there but there but my y coordinate takes on the last value of y so they are getting appended on top of each other in the same location. |
Henrik 28-Aug-2007 [7156] | yes, because the block is never reduced, so 'y is used directly, instead of a reduced block where the value of y at the given time would be inserted into the block. |
amacleod 28-Aug-2007 [7157x2] | How do I get y value to reduce before append |
and for that mater my dat values | |
Henrik 28-Aug-2007 [7159] | see my example above. it does exactly that. |
amacleod 28-Aug-2007 [7160] | Bingo! I had to compose too: b: compose [at (to-pair reduce [80 y]) text bold font-size 15 (reduce dat/1)] |
Henrik 28-Aug-2007 [7161] | strictly you don't need reduce inside the compose block. you can settle for: compose [at (to-pair 80 y) text bold font-size 15 (dat/1)] |
amacleod 28-Aug-2007 [7162] | thanks a lot Henrik |
Henrik 3-Sep-2007 [7163] | Anton, did you make a fix for editing center and right aligned fields? Could I be allowed to work this into my own set of patches for FIELD? |
eFishAnt 15-Sep-2007 [7164] | Where can I find the simplest example of an image player, like playing GIF anims in REBOL? There has to be some very simple ones that just flip at some "frame rate" (rather than Drawing) |
Graham 15-Sep-2007 [7165] | ask Chris |
eFishAnt 15-Sep-2007 [7166] | I looked at his plug-in example, fairly comprehensive but I was looking for simpler...thanks. |
btiffin 15-Sep-2007 [7167] | Steve; Check out RebGUI. anim widgets can do multiframe gifs |
Ashley 16-Sep-2007 [7168] | They can? anim just cycles a block of images. Source is here out of interest: http://trac.geekisp.com/rebgui/browser/widgets/anim.r |
btiffin 16-Sep-2007 [7169x2] | Yeah, just feed the anim data [(first gif) (second gif) (third gif) ...] for how many frames there are. :) |
I guess I should have mentioned that. | |
eFishAnt 16-Sep-2007 [7171x5] | thanks, that is helpful...it is simple and is similar enough. One thing I was wondering was if I have to do a load or not from ram...or a copy. still experimenting. I was trying a make image! to clone each picture.. |
well, a 1000 frames does show up as 43.2 Megabytes...so it seems the size is there in RAM. | |
So, this should be a valid test. This SHOULD mean I can play a minute videa in less than a second. | |
My original tests indicated that. | |
My main question is really how to best assemble gifs to make the anim up, rather than how to play. I am mostly looking at RView 1.3 at the moment with it's image! datatype. I thought I saw a bit of document which had a simple line of the way to append (or whatever) the images into a block or whatever. | |
Gregg 16-Sep-2007 [7176] | If you have an animated GIF, try just using the standard ANIM style in VID; I thought it played them. Creating the animated GIF is a different story, but if you have a bunch of images, or a motion JPG file/stream, it's easy to parse and play. |
eFishAnt 16-Sep-2007 [7177x3] | yes. but what I am doing is creating one, and REBOL doesn't always copy things, so the resultant sequence doesn't play. |
It seems like all the image data is just one value of rgb. | |
Aha! got that warm spot of the exact right words in REBOL to get the right things in the right place at the right time. Whew! Thanks for the ideas. | |
Chris 16-Sep-2007 [7180] | My animation style was for animated-Gif *level* animations. You still need all frames stacked up on each other in a single image file. Unfortunately not the way anim-gif creation programs work... |
eFishAnt 16-Sep-2007 [7181x4] | I found the silver bullet. Thanks for all the ideas. I ended up usng append. Nothing fancy, just it takes me extra time to get the data structure so it works, and the code was pretty tense in many aspects. I do remember some doc that had a note about making .gif anims from REBOL but still haven't found. |
Chris, your code, presentations, examples are alwayts top-notch. I learn a LOT reading through them...and enjoy watching them too. | |
Some time we gotta catch up. | |
What is the latest Revision of Rebol/View with async? 2.5.53 or higher? | |
Graham 17-Sep-2007 [7185] | How do you set the toggle style back to it's initial state ? |
Brock 17-Sep-2007 [7186] | toggle/state: false |
Gregg 17-Sep-2007 [7187] | 2.5.53 might have been it Steve. |
Graham 17-Sep-2007 [7188] | nope, tried that already. |
older newer | first last |