tags:

views:

53

answers:

1

I tried to implement a save-as-ftp button in Rebol embedded editor. Implementation of the save-as-button is this:

save-as-ftp: has [file-content][

    file-content: t1/text

    prefs-file: rejoin [_self-path %ftp.preferences.txt]

    either exists? prefs-file [
        prefs-ftp: construct load prefs-file; see article application configuration file
        user: prefs-ftp/user
        password: prefs-ftp/password
        server-path: prefs-ftp/server-path
    ][
        user: ask "User: "
        password: ask/hide "Password: "
        server-path: ask "Server-Path: "
    ]

    view ftp-view: layout [
        origin 10x10 space 8x4  
        style btn btn 140 
        ftp-field: text bold "" 140 center 
        pad 0x4 
        btn-enter 140 "Save" #"s" [hide-popup result: ftp-field/text] 
        btn red + 50 "Quit - No Save" [hide-popup quit-now] 
    ]        
    file-target: result
    ftp-target: rejoin [ftp:// user ":" password "@" server-path file-target]
    write ftp-target file-content
    print ["uploaded" file-target "to" rejoin [ftp:// "XXXXXXX" ":" "XXXXXXX" "@" server-path]]
    true

]

My problem is with view ftp-view : I cannot even type in ftp-field text box as the popup window loses focus.

+1  A: 

hide-popup is used to close a modal window. A modal window is opened by using 'inform

I don't see any modal windows here.

Oh .. this is a button or something that you are attaching to the rebol editor?

I modified mine some years ago to edit ftp files ... I'll have to see if I can find what I did.

Graham Chiu
Hey thanks a lot. Isn't it also you that made the soap script server ;)http://stackoverflow.com/questions/2000169/rebol-soap-server
Rebol Tutorial