Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 03 2017 05:53
    @PeterWAWood banned @matrixbot
  • Sep 28 2016 12:19
    @PeterWAWood banned @TimeSeriesLord
  • Aug 13 2016 03:23
    @PeterWAWood banned @Vexercizer
nedzadarek
@nedzadarek
@rebolek
Boleslav Březovský
@rebolek
@nedzadarek yes, that's how you can start and stop the timer. You can put starting in on-up also.
nedzadarek
@nedzadarek
@rebolek I see, thank you.
Boleslav Březovský
@rebolek
you're welcome
Gregg Irwin
@greggirwin
On line endlings, it's tricky because using native controls likely means their data will need to be CRLF on Windows. If you just have LF, area likely won't render it correctly.
While Red is single threaded, blocking needs creative handling. For a wait of a couple seconds, I might just put up a window, like we did in the old days. I mean, how much work can the user do in 2 seconds, and how much effort or other issues might come up by letting them mess around during that time. This will hold true even once Red has concurrency.
nedzadarek
@nedzadarek
@greggirwin 2 seconds was just an example. I am creating an image. With bigger image and that that it is based on I need to compute more data.
lepinekong
@lepinekong_twitter
@toomasv I want to convert treeview to a 2-D view something like this:
https://i.imgur.com/37TOgyX.png
Is there something like collapsible panel instead of static group-box/panel ?
window: [
    title "Layout"
    size 800x800
    group-box "01-file-header" 780x50 [
        panel
    ]
    return
    group-box "02-bookmarks" 780x600 [
        panel [
            group-box "01.init-variables" 740x70 [
                panel [
                    text {.url-0: >url}
                ]
            ]
            return
            group-box "02.reload-favorites" 740x70 [
                panel [
                    text {.reload-favorites}
                ]
            ]
            return
            group-box "04.add-bookmark.sub-function" 740x70 [
                panel [
                    text {.add-readable favorites 'bookmarks reduce [>url]}
                ]
            ]
            return    
            group-box "05.either-block-url" 740x400 [
                panel [
                    group-box "true" 350x400 [
                        panel
                    ]
                    group-box "false" 350x400[
                        panel
                    ]                    
                ]
            ]                                
        ]
    ]    
]



view window
lepinekong
@lepinekong_twitter
Is there some limit in VID nested levels ? I get stackoverflow if I add an area inside the last nested groups:
https://i.imgur.com/fbFnbzk.png
Red [
    Title: ""
]

file-header: [

]

init-variables: [

]

bookmarks: [
    groupbox [
        panel init-variables
    ]
]

window: [
    title "Layout"
    size 1200x800
    group-box "01-file-header" 1000x50 [
        panel
    ]
    return
    group-box "02-bookmarks" 1150x600 [
        panel [
            group-box "01.init-variables" 740x80 [
                panel [
                    area 500x40 {.url-0: >url}
                ]
            ]
            return
            group-box "02.reload-favorites" 740x80 [
                panel [
                    area 500x40 {.reload-favorites}
                ]
            ]
            return
            group-box "04.add-bookmark.sub-function" 740x80 [
                panel [
                    area 500x40 {.add-readable favorites 'bookmarks reduce [>url]}
                ]
            ]
            return    
            group-box "05.either-block-url" 1100x400 [
                panel [
                    group-box "01.is-block.url.true" 800x400 [
                        panel [
                            group-box "01.is-category.first-word.true" 330x400 [
                                panel [
                                    area "stackoverflow !!!!!!"
                                ]
                            ]
                            group-box "01.is-category.first-word.false" 330x400 [
                                panel 
                            ]                            
                        ]
                    ]
                    group-box "01.is-block.url.false" 500x400 [
                        panel [
                            area {.add-readable favorites 'bookmarks (>url)} wrap
                        ]
                    ]                    
                ]
            ]                                
        ]
    ]    
]



view window
Gregg Irwin
@greggirwin

There is no collapsible panel style.

There is no intended limit to nesting, and I don't get the error on a local build under Win10.

lepinekong
@lepinekong_twitter
@greggirwin ok thanks, maybe it's because vscode points to this version of red, will have to change I guess:
console-2017-8-3-49893.exe Internal Error: stack overflow Where: srs Stack: view layout layout layout layout layout layout layout layout layout eval-set-path empty?
nedzadarek
@nedzadarek
@lepinekong_twitter 1) can you use tab-panel instead? 2) You can change the size / make it invisible and rearrange elements around it.
lepinekong
@lepinekong_twitter
@nedzadarek ok I didn't know tab-panel, I'll try thanks.
@greggirwin under October build, I can go further but it still crashes in the end :)
Red [
    Title: ""
]

window: [
    title "Layout"
    size 1200x800
    group-box "01-file-header" 1000x50 [
        panel
    ]
    return
    group-box "02-bookmarks" 1150x600 [
        panel [
            group-box "01.init-variables" 740x80 [
                panel [
                    area 500x40 {.url-0: >url}
                ]
            ]
            return
            group-box "02.reload-favorites" 740x80 [
                panel [
                    area 500x40 {.reload-favorites}
                ]
            ]
            return
            group-box "04.add-bookmark.sub-function" 740x80 [
                panel [
                    area 500x40 {.add-readable favorites 'bookmarks reduce [>url]}
                ]
            ]
            return    
            group-box "05.either-block-url" 1100x400 [
                panel [
                    group-box "01.is-block.url.true" 800x400 [
                        panel [
                            group-box "01.is-category.first-word.true" 430x400 [
                                panel [
                                    area wrap {favorite-bookmarks: favorites/bookmarks
existing-category: select (favorite-bookmarks) (category)}
                                    group-box "01"  [
                                        panel [
                                            area {crash under october build}
                                        ]
                                    ]
                                    group-box "02"  [

                                    ]                       
                                ]
                            ]
                            group-box "02.is-category.first-word.false" 230x400 [
                                panel [
                                    area wrap {.add-readable favorites 'bookmarks reduce [>url]}
                                ]
                            ]                            
                        ]
                    ]
                    group-box "02.is-block.url.false" 500x400 [
                        panel [
                            area wrap {.add-readable favorites 'bookmarks (>url)} wrap
                        ]
                    ]                    
                ]
            ]                                
        ]
    ]    
]



view window
lepinekong
@lepinekong_twitter
@nedzadarek I don't think tab-panel is suitable for my usecase because I want to be able to see ALL nested children at once if wanted ?
nedzadarek
@nedzadarek
@lepinekong_twitter then I guess 2), something like this:
view [
across
do [p-size: 200x100 ] 
p: panel 200x100 [base blue base red] return
t: text yellow "this should move" return
button "hide" [p/size/y: p-size/y * 20% t/offset/y: (p/offset/y + p/size/y + 10) probe t/offset] 
button "show" [p/size: p-size t/offset/y: probe ((probe p/offset/y) + p/size/y + 10) probe t/offset]
]
Gregg Irwin
@greggirwin
For usability, nesting too deep isn't good anyway. It's good to note these limits, but when you hit them, start thinking about other ways to tackle the problem.
lepinekong
@lepinekong_twitter
@greggirwin there's no usuability here it's the core purpose: this is about documenting code and see its nested children ;)
@nedzadarek thanks, interesting.
nedzadarek
@nedzadarek
@lepinekong_twitter Maybe you could do something like directory tree? Depending on your needs your "directory list" might be simple listing. What you need to change is the panel on "the right".
lepinekong
@lepinekong_twitter
@nedzadarek I have already a directory treeview based on @toomasv lib, I wanted to be able to get a 2D-View from it showing in // some stuffs as well as content.
Since I'm talking about treeview, is there a way I can select all content in console ? Ctrl+A doesn't seem to work and select with the mouse doesn't seem to support scrolling as usual on Windows :
https://i.imgur.com/uklzU8S.png
ne1uno
@ne1uno
^A does select all and I think mouse scrolling was just added?
ne1uno
@ne1uno
is there some reason you want to keep using an old version except to test if something used to work and no longer does?
Palaing
@Palaing

Hi all,
I tried this (this worked in Rebol):

aview: layout [p: panel white]
specs: copy []

do build_specs: does [
    append specs [text "hello"]
]    

do build_p: does [
    p_lay: layout specs 
    p/pane: p_lay/pane
]

view aview

but the view is not built.
I had to do this to get my expected view:

build_specs: does [
    append specs [text "hello"]
]    
build_specs

build_p: does [
    p_lay: layout specs 
    p/pane: p_lay/pane
]
build_p

Is this a bug or a feature?

Vladimir Vasilyev
@9214
@Palaing this is intended, do does not evaluate its function! argument.
Toomas Vooglaid
@toomasv
@lepinekong_twitter Little patience more!
accordion
Eric Guedes Pinto
@ericguedespinto
looks great!
Eric Guedes Pinto
@ericguedespinto

Hi, I need some help with parse please
I am trying to apply a rule in a sub-block using into but I can't figure what I am doing wrong:

rule: [ 'f set w word! (probe w) ]
parse [ a b 'f c1 d [ a b 'f c2 d ] ] [ to [ rule | ahead block! into rule ] ]

I want to match both c1 and c2. Any ideas?

Vladimir Vasilyev
@9214
@ericguedespinto you're bumping into ds.
And it should be quote 'f.
e.g.
>> rule: [quote 'f set match word! (probe match) 'd]
== [quote 'f set match word! (probe match) 'd]
>> parse [a b 'f c1 d [a b 'f c2 d]][thru rule into ['a 'b rule]]
c1
c2
== true
Vladimir Vasilyev
@9214
@dockimbel :point_up: looks like matching of any-word! is still a bit relaxed (quote 'f can be substituted with 'f).
Another way:
>> rule: ['f set match word! (probe match)]
== ['f set match word! (probe match)]
>> parse [a b 'f c1 d [a b 'f c2 d]][some thru [rule | ahead block! into ['a 'b rule 'd]]]
c1
c2
== true
Toomas Vooglaid
@toomasv
@ericguedespinto Simplest way to just match both c-s seems to be
>> rule: [ thru 'f set w word! (probe w) ]
>> parse [ a b 'f c1 d [ a b 'f c2 d ] ] [ rule skip into rule ]
c1
c2
== false
Vladimir Vasilyev
@9214
@toomasv rather
>> rule: [thru 'f set w word! (probe w) skip]
== [thru 'f set w word! (probe w) skip]
>> parse [a b 'f c1 d [a b 'f c2 d]][rule into rule]
c1
c2
== true
Toomas Vooglaid
@toomasv
Yes
Vladimir Vasilyev
@9214
@ericguedespinto the culprit was actually the absence of some or any in your rule. to searched for the first pattern only once.
Eric Guedes Pinto
@ericguedespinto
Thank you
Palaing
@Palaing
@9214 Thank you for explanation. Though I'm not sure why this behaviour is good...
Vladimir Vasilyev
@9214
@Palaing why use do does [...] if you can just write do [...]?
Though, I agree that R2 is nicer in this case
>> do func [x y][x * y] 2 4
== 8
Versus Red:
>> do func [x y][x * y] 2 4
== 4
>> do reduce [func [x y][x * y] 2 4]
== 8
Palaing
@Palaing
@9214 because I re-use the function later
so I give it a name at the same time
Vladimir Vasilyev
@9214
do reduce [
    build_specs: does [
        append specs [text "hello"]
    ]    

    build_p: does [
        p_lay: layout specs 
        p/pane: p_lay/pane
    ]
]

view aview
Palaing
@Palaing
@9214 thank you, that's what I looked for!
Toomas Vooglaid
@toomasv
@ericguedespinto Thinking a bit further on your example, it can be solved in spirit of your original example, but three things need to be changed; first, as @9214 said you need to use repeater, any or some; second, you cannot go into rule, because this results in failure -- into rule would have matched your input only at the point where rule matched it, i.e. at 'f cx. You need to go into the second rule - the one in which you are already. And third, you need a skip to hop over unmatched values:
>> rule1: [ 'f set w word! (probe w) ]
== ['f set w word! (probe w)]
>> parse [ a b 'f c1 d [ a b 'f c2 d ] ] rule2: [ some [rule1 | ahead block! into rule2 | skip ] ] 
c1
c2
== true
Toomas Vooglaid
@toomasv

@lepinekong_twitter

is there a way I can select all content in console ?

write/lines %history.tmp gui-console-ctx/cfg/history
Vladimir Vasilyev
@9214
@toomasv system/console/history