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

Yet More VID Help...

 [1/5] from: chalz::earthlink::net at: 16-Apr-2006 4:28


Yep, it's me again. I'm getting the increasing feeling I'm either over my head, or missing some very simplistic explanation... Something I'm working on with VID involves a "list" with two columns of data. Easy enough to set up. I create a bunch of styles outside of layout, one of which is
>> out-list: list 254x512 [origin 0 across text 60 text 80]
Then after loading the styles in the layout, I do:
>> out-disp: out-list data [[0 "="] [1 "+"]]
That's great. It works. The problem is, I can't figure out where the data is being stored, how to access it, manipulate it, add on to it, etc. I printed out the contents, and the only place I could find the data was in
>> subfunc: func [face count index /item /stuff][
stuff: [[0 "="] [1 "+"]] either count > length? stuff [face/text: "" face/image: none] [ set-it face stuff index count ] ] So, I don't get it. With most other types, you can access <object>/text or <object>/data. What's going on here? On a subnote, is there a doc elaborating on the pre-defined styles available? Again, my thanks to you all. --Charles

 [2/5] from: anton::wilddsl::net::au at: 17-Apr-2006 3:11


Hi Charles, Yes, you found a craziness of the inbuilt list style. The block directly in the subfunc body, referenced by the local word stuff is indeed the only way to access the data. [If you write clipboard:// mold system/view/vid/vid-styles/list, you can see in the words dialect (search for "words:") that the data keyword uses compose/deep to put the user data into the block referenced by stuff. Totally crazy.] The solution is to get mad and launch into writing your own list style, firstly advertising its virtues, then defending its lack of features during its development from the attacks of others who feel let down by the marketing hype. But to solve your immediate problem; if you have a list named my-list: layout [my-list: list 100x200 data [...]] then, if not using a supply function, you can determine the list block with this: stuff: second second get in my-list 'subfunc That gets the second item in the body of subfunc. I can't remember an official doc of the all the built-in styles, but there are definitely many examples by various people here. Here's one of mine: do http://home.wilddsl.net.au/anton/rebol/gui/iterated/demo-vid-list-scroller.r Regards, Anton.

 [3/5] from: chalz::earthlink::net at: 17-Apr-2006 3:59


On Sun, 16 Apr 2006 13:11:33 -0400, Anton Rolls <anton-wilddsl.net.au> wrote:
> Hi Charles, > > Yes, you found a craziness of the inbuilt list style.
I seem to be getting told that sort of thing frequently..
> The block directly in the subfunc body, referenced by the local > word stuff is indeed the only way to access the data.
Has anyone addressed this issue with RT? It seems an unusual inconvenience, unless I'm - as often happens - completely missing something..?
> stuff: second second get in my-list 'subfunc > > That gets the second item in the body of subfunc.
That's all well and good, but I'm having a devil of a time modifying the data so it'll show up when I use 'show my-list'. Presumably I'd have to modify 'subfunc's code, yes? Or could I re-define 'subfunc so that 'stuff refers to the 'data field in the object? I'm sorry for being the total newbie - I've hobbied with REBOL for a few years, but haven't gotten really deep into it. I'd like to make more use of it, but I seem to have plans grander than my abilities, and I don't often know where to go to figure it out. It's not that I want anyone to write it for me, but I sometimes don't know where to begin learning, even. Shoot, I still haven't even mastered parse - one of those "I keep meaning to" things. So, I pray you'll all bear with me and my apparent density. And, for the dozenth time: Thanks. --Charles

 [4/5] from: volker:nitsch:gm:ail at: 17-Apr-2006 11:17


On 4/16/06, Charles <chalz-earthlink.net> wrote:
> Yep, it's me again. I'm getting the increasing feeling I'm either over my > head, or missing some very simplistic explanation...
<<quoted lines omitted: 15>>
> So, I don't get it. With most other types, you can access <object>/text or > <object>/data. What's going on here?
Magic. And the magician didn't bother about changing lists to much. Use 'supply, like this: rebol [] stuff: copy [] view layout [ lst: list [across info info] 400x400 supply [ either count > length? stuff [face/text: "" face/image: none] [ lst/set-it face stuff index count ] ] ; with [probe words source set-it] ; get some hints button "add now" [ append/only stuff reduce [mold 1 + length? stuff mold now/time] show lst ] ]
> On a subnote, is there a doc elaborating on the pre-defined styles > available?
<<quoted lines omitted: 3>>
> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
-- -Volker Any problem in computer science can be solved with another layer of indirection. But that usually will create another problem. David Wheeler

 [5/5] from: nick::guitarz::org at: 17-Apr-2006 2:56


Hi Charles, Take a look at Henrik Mikael Kristensen's listview widget: http://www.hmkdesign.dk/rebol/list-view/list-view.html It's really useful, and very easy to learn. Here are some examples: rebol [] if not exists? %list-view.r [write %list-view.r read http://www.hmkdesign.dk/rebol/list-view/list-view.r ] do %list-view.r data-block: [["asdf" "sdfg" "dfgh"] ["qwer" "wert" "erty"]] view center-face gui: layout [ theview: list-view 775x200 with [ data-columns: [one two three] data: copy data-block ] ] rebol [] if not exists? %list-view.r [write %list-view.r read http://www.hmkdesign.dk/rebol/list-view/list-view.r ] do %list-view.r data-block: [["asdf" "sdfg" "dfgh"] ["qwer" "wert" "erty"]] view center-face gui: layout [ theview: list-view 775x200 with [ data-columns: [one two three] data: copy data-block editable?: true ] across button "add row" [theview/insert-row] button "remove row" [theview/remove-row] button "filter data" [ filter-text: request-text/title trim { Filter Text (leave blank to refresh all data):} theview/filter-string: filter-text theview/update ] button "save db" [save %data.txt theview/data] ] You can edit the data by clicking right on the listview. It does a lot more too. The documentation page above explains it all in detail... Quoting Charles <chalz-earthlink.net>:

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