[REBOL] Re: pair-edit style - desktop url argument
From: anton::lexicon::net at: 20-Jun-2002 23:14
Yeah, I thought this too. 'desktop should be like 'browse.
We could probably patch desktop to do this, I reckon.
Looking in ctx-viewtop:
desktop ; first go to desktop and then exit to console
print mold first ctx-viewtop
I see some interesting looking words:
load-index
goto-url
find-site
goto-view
but it turns out that the function we want is
show-folder, which takes a url argument eg.
ctx-viewtop/show-folder site/index.r
Now we just need to patch desktop so it takes an
optional argument. Here's the original desktop:
desktop: func [][
if block? ctx-viewtop [ctx-viewtop: context ctx-viewtop]
ctx-viewtop/init-desktop
do-events
]
The patched version:
desktop: func [url [url! file! any-type!]][
if block? ctx-viewtop [ctx-viewtop: context ctx-viewtop]
ctx-viewtop/init-desktop
if value? 'url [ctx-viewtop/show-folder :url]
do-events
]
Now you can go directly to my site first (:
desktop http://www.lexicon.net/anton/rebol/gui/index.r
>From there, it's one click to demo-pair-edit.r :)
Seems to work pretty well, though I thought I noticed it not working
once in a new rebol. Anyone else notice this, please report it.
Anton.