World: r3wp
[View] discuss view related issues
older newer | first last |
Anton 12-Sep-2009 [9116] | Thankyou, closed source. |
Maxim 12-Sep-2009 [9117] | I was about to try fiddling around in the vid sdk code to see if some context holds the face expecting the away events.. but your post sort of confirms that I won't find it :-( |
Henrik 12-Sep-2009 [9118] | anyhow, it should be RAMBO'ed, so others can see it as a known bug. |
Pekr 12-Sep-2009 [9119] | new down-face is set when you click down - just curious. What if you would like to do multi-selection? I mean - holding shift down, and selecting e.g. some list elements? You have to remember all down faces, no? |
Maxim 12-Sep-2009 [9120x2] | yes but not in the event system. |
what happens here is that a down event always expects (and creates) an up event ... but since the face is removed while in the handling of the down event it gets mixed up and this face gets stuck somewhere deep in the view core and it ends up with a reference to a face which isn't displayed anymore... so it tries to get that (away) event to trigger over and over . what I fear most is that the face will end up leaking RAM. but tests have not shown it to be the case so far. | |
Anton 14-Sep-2009 [9122] | A down event does not create an up event. You letting go of the mouse button creates the up event. |
Maxim 14-Sep-2009 [9123] | there is always an up event corresponding to the down event for a face you clicked on, even if the face is removed from you or you aren't releasing the mouse over it. there is also a move event triggered each time for some obscure reason. |
Anton 14-Sep-2009 [9124] | The reference to the "down-face" is probably stored by View in a single variable. When you click down again on another face, that reference is changed, so (I assume) there should be no problem. |
Maxim 14-Sep-2009 [9125] | exactly. |
Anton 14-Sep-2009 [9126x3] | If you don't release the mouse button, you don't get an up event. |
What you're saying is when the up event comes, it is sent to the engage of the face that was clicked down on, no matter where the mouse is now. | |
But anyway, just nitpicking. | |
Maxim 15-Sep-2009 [9129x2] | yes and it continues to send it away events every time you cross the boundry of a face ! |
anyone know a way to prevent text-list from picking more than one item with ctrl? | |
BenBran 23-Sep-2009 [9131] | I need some clairfication in reading the syntax/specs for Rebol2.x stuff. I'm sure there is a pattern, but I havn't seen it yet. Example: taken from rebol.net/wiki/VID:_Styles#Derived_styles_2 TEXT-LIST size: pair! rows: block! selected: block! ; this way set-face will not work. need to solve this. action: block! background: tuple! background-draw: block! how do I know when to assign a value to a [word] i.e. lo: [text-list size: 300x200] ;;does not work view layout lo and when not to use the [word] such as lo: [text-list 300x200] ;; works view layout lo Question 2. Could someone give a one line (short as possible) example of setting all the values for this text-list keyword using this format lo: [text-list ......] view layout lo thanks in advance. |
Henrik 23-Sep-2009 [9132] | The guide you are using is for VID3 for REBOL 3, which is no longer in use. |
Dockimbel 23-Sep-2009 [9133] | The documentation you've pointed to seems related to R3, not R2.x. There's no header info in that page, so just guessing. You'll find REBOL 2.x view documentation here : http://rebol.com/docs.html More precisely: http://rebol.com/docs/view-guide.html http://rebol.com/docs/easy-vid.html#section-14 (for TEXT-LIST examples) About your question, here's a more complete example (not sure that all possible options are there, thought) : lo: [text-list 300x200 yellow blue data ["one" "two" "three"] [print "action"]] view layout lo |
BenBran 23-Sep-2009 [9134x2] | Thank you both. Is it possible to create columns as well or is text-list a single column entity? |
or maybe incorporate tabs? | |
Dockimbel 23-Sep-2009 [9136x3] | AFAICT, text-list is single column. Henrik has done some nice new components for VID, his LIST-VIEW style should fullfill your needs. Have a look at : http://www.hmkdesign.dk/rebol/page0/page0.html |
Here's a quick link to what you're looking for : http://www.hmkdesign.dk/rebol/list-view/docs/list-view.html#section-3 | |
Btw, here's another useful link about VID styles : http://www.codeconscious.com/rebol/vid-notes.html | |
BenBran 23-Sep-2009 [9139] | thanks for the links. I do have that list-view, I was trying to find a smaller way out. It was missing one or two features I was wanting last I checked, and didn't feel like pouring over the source code. about 100 pages. My brain would take quite a few months to understand it. Excellent software though. I'll give it some more thought, and thanks again for the vid-notes link. It looks very clean. |
Dockimbel 23-Sep-2009 [9140x2] | Digging out the old but still very good for quick VID learning vid-usage.r script: http://www.rebol.org/view-script.r?script=vid-usage.r |
If you want a small solution, you can use the LIST style, but it's a bit more complex to work with. You can find some examples in the vid-usage.r script (look of some examples is horrible, but it will show you how to build custom multi-column lists). | |
BenBran 23-Sep-2009 [9142] | well.... looking back through my coded examples... I actually have a good working list-box with over l000 rows with the columns correctly spaced. However, its missing some necessary features, one of which is how do i attach the vertical scrollbar to the list box. I tried the vid-usage.r script but perhaps I must have missed some key elements. I'll try looking at that again. |
Dockimbel 23-Sep-2009 [9143x4] | I wrote a quick example to show you how to achieve that : ] |
data: make block! 16 loop 16 [repend/only data [random "012345789" random "abcdefghij"]] visible: 5 ; number of visible lines window: (length? data) - visible ; sliding window size cursor: 0 view layout [ across space 0x0 grid: list 200x100 [ across txt 100 txt 100 ] supply [ if row: pick data count + cursor [face/text: pick row index] ] sc: scroller 16x100 [ cursor: sc/data * window show grid ] do [ sc/step: 1 / window ; initializing scroller steps granularity ] ] | |
Forgot to set the scroller bar size, the 'do init code should be : do [ sc/step: 1 / window ; initializing scroller steps granularity sc/redrag 5 / length? data ; initializing scroller bar size ] | |
or even better : sc/redrag visible / length? data | |
BenBran 24-Sep-2009 [9147] | That is an excellent example. Answered many questions I had (and raised a few more). Thank you for taking the time to show me this Dockimbel. |
Dockimbel 24-Sep-2009 [9148x2] | I'm glad it helped you. It was a good opportunity for me to refresh my memory about the (powerful but under-documented) LIST style. |
In case you're wondering about the block after SUPPLY, it's used internally by the LIST style to build an iterating function defining a local context where COUNT refers to the current row and INDEX to the current column. Each horizontally positionned face (purpose of the ACROSS keyword) defined in the LIST layout block, is counted as a column, so: txt 100 txt 100 => 2 columns. | |
amacleod 24-Sep-2009 [9150] | I'm need to get the name I assigned a face when I alt-click on it. I can get its style, offset, size etc but I do not see a way to get the face's name. More specificly I have multiple scroll-panels and I need to know the one I'm clicking in... |
Graham 24-Sep-2009 [9151] | What name? |
amacleod 24-Sep-2009 [9152x3] | a: scroll-panel [blah blah blah b: scroll-panel [blah blah blah I want to know if I clciked in scroll-panel a or b |
if event/type = 'alt-down [face/style] ...gives me 'scroll-panel' how do i get 'a' or 'b' | |
Sorry for the possible confusion but its one of anton's styles but did not think it would make a diff. | |
Graham 24-Sep-2009 [9155] | face = a ?? |
Henrik 24-Sep-2009 [9156] | face/var |
amacleod 24-Sep-2009 [9157x2] | yeah? |
it works... | |
Henrik 24-Sep-2009 [9159] | of course it does :-) |
amacleod 24-Sep-2009 [9160x2] | I thought about var but I thhought that would be too simple to work... Thanks alot Henrik! |
Is that because its Anton's style or is that a rebol thing for all faces? | |
Henrik 24-Sep-2009 [9162x2] | no problem |
face/var is set during layout for all faces that have a set-word! attached. | |
amacleod 24-Sep-2009 [9164] | great! Thanks! |
Henrik 24-Sep-2009 [9165] | you can also set it yourself like this: scroll-panel [with: 'a] |
older newer | first last |