Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 20 2019 22:59
    @dockimbel banned @SmackMacDougal
  • 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
@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
Toomas Vooglaid
@toomasv
Good child has many names gui-console-ctx/terminal/history
Vladimir Vasilyev
@9214
@toomasv
>> same? gui-console-ctx/terminal/history system/console/history
== true
Toomas Vooglaid
@toomasv
Of course, there is not a different good child for every name.
nedzadarek
@nedzadarek
Isn't *-ctxleaked objects?
Could be substituted with do in context [...] 'launch I guess, or something similar, to keep object! anonymous.
nedzadarek
@nedzadarek
@9214 yes, but is it intentional or did they just forgot to make them anonymous? There is 2 such objects: help-ctx & gui-console-ctx.
@toomasv :clap: when they improve modules for gui I bet you will contribute the most modules.
ne1uno
@ne1uno
doesn't the menu use gui-console-ctx? why would you want to hide it?
nedzadarek
@nedzadarek
@ne1uno you don't have to have every word in the "global space" to use it. Whenever it's good or bad is up to language designer.
lepinekong
@lepinekong_twitter
@toomasv great accordion ;)
@ne1uno I'm not using old version but I don't keep up with latest build everytime, I'll try with latest since you say ^A had been implemented :)