Rebol Talk Forum  |  REBOL Discussions  |  REBOL View  |  Topic: Path name requester
Pages: [1] Print
Author Topic: Path name requester  (Read 1625 times)
Gord
Newbie
*
Offline Offline

Posts: 18


View Profile
Path name requester
« on: June 08, 2006, 01:53:20 PM »

Is there a command that allows the user to pick a directory?

I was modifying an existing rebol script and wanted to add a requester for a directory/folder for storing images and can't seem to put my finger on a command that would be similar to 'request-file' but allow the user to select just a directory/folder.  The 'request-file/path' options still insists that you pick a file and won't return until you do.  If your directory is empty where you want to store the images then you can't return at all because there is no file to click on.
Logged
henrikmk
Jr. Member
**
Offline Offline

Posts: 50


View Profile
Re: Path name requester
« Reply #1 on: June 09, 2006, 09:27:39 AM »

request-dir
Logged
Gord
Newbie
*
Offline Offline

Posts: 18


View Profile
Re: Path name requester
« Reply #2 on: June 09, 2006, 11:13:29 AM »

Thanks

Where did you find this?  I don't see it mentioned in the Rebol Dictionary nor the Rebol user's guide!
Logged
Gabriele
Full Member
***
Offline Offline

Posts: 182


View Profile WWW
Re: Path name requester
« Reply #3 on: June 10, 2006, 05:01:35 AM »

Code:
>> help "request"
Found these words:
   local-request-file native! Creates an OS-specific file requester
   request         function! Requests an answer to a simple question.
   request-color   function! Requests a color value.
   request-date    function! Requests a date.
   request-dir     function! Requests a directory using a popup list.
   request-download function! Request a file download from the net. Show progres...
   request-file    function! Requests a file using a popup list of files and di...
   request-list    function! Requests a selection from a list.
   request-pass    function! Requests a username and password.
   request-text    function! Requests a text string be entered.
Logged
Brock
Newbie
*
Offline Offline

Posts: 14


View Profile
Re: Path name requester
« Reply #4 on: June 10, 2006, 11:34:58 AM »

I believe this is a new addtion to Rebol with 1.3.2, contributed by one of the Rebol Gurus.  Notice the difference in style used in request-file and request-dir.  Prior to request-file using the local-os dialogue, the look was much different than both of these.  I wouldn't be surprised if the dialogues become more consistant with Rebol 3.
Logged
Gord
Newbie
*
Offline Offline

Posts: 18


View Profile
Re: Path name requester
« Reply #5 on: June 10, 2006, 01:16:23 PM »

Thanks guys.  I didn't think to look for help on a partial word match.

I noticed right away that request-dir uses the Rebol view interface and request-file uses what seems to be a OS compatible (at least for Windoze) interface.  I've added a help string in the program to explain how to use the Rebol view directroy requester.

I've uploaded the program to the Library, (ngbg2.r).  It is a considerable modification to the original "Foto Of The Day" program by Ian Munroe.  Instead of just downloading one photo it will download all of them (just under 2000 high quality photos) along with the captions and credits, creates web pages for each photo so you can browse them forward and backward.  Lots of fun.  I now change my Windoze backdrop page everytime I reboot, (a couple times a month).
Logged
Anton
Jr. Member
**
Offline Offline

Posts: 66

Rebol veteran


View Profile WWW
Re: Path name requester
« Reply #6 on: August 20, 2006, 01:54:16 PM »

You might like to try my attempt at request-dir.
It's not quite 100% finished, but it does the basic functionality correctly.

do http://anton.wildit.net.au/rebol/gui/demo-directory-selector.r

It shows both directories and files in the list, but only allows you to select directories.
Logged
DideC
Newbie
*
Offline Offline

Posts: 32


View Profile
Re: Path name requester
« Reply #7 on: September 08, 2006, 11:46:07 AM »

The request-dir actually in View 1.3.2 is from Carl himself.
It is based on a code he release some years ago (where ? sorry, can't remember)

Based on his code, here is a simple attempt at presenting the whole thing in a kind of treeview.
As you posted ngbg2 in the Library, you could have found it there ;-)

To try it, just copy/paste in the console

do http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=request-dir.r
request-dir


PS: I'm aware of the small visual bug between lines, It's due to the AGG engine and was not present in old View engine. If you want to correct it, change the line :

   links: [ [draw [pen 0.0.0 line 6x0 6x9 12x9]] [draw [pen 0.0.0 line 6x0 6x19 line 6x9 12x9]] ]
by
   links: [ [draw [pen 0.0.0 line 6x-1 6x9 12x9]] [draw [pen 0.0.0 line 6x-1 6x19 line 6x9 12x9]] ]
Logged
Pages: [1] Print 
Rebol Talk Forum  |  REBOL Discussions  |  REBOL View  |  Topic: Path name requester
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 21, 2008, 03:43:47 PM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2294 Posts in 593 Topics by 3753 Members
Latest Member: swift

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc