Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: editor

From: jim:clatfelter at: 27-Jun-2002 20:51

Thanks for trying to help. The script works for awhile, but I eventually wind up with an error. This usually happens after I use the keyboard. ** Script Error: caret-xy has no value ** Where: paste ** Near: system/view/caret: offset-to-caret a1 caret-xy The timer seems like a good way to remember the caret position. Clicking a button when the text is dirty drops the focus on the area. The caret is gone. I don't know why caret-xy has no value at times. It seems like it should always have a value. Maybe the timer reads no value when the text is dirty, though it sometimes does. It would be nice to be able to keep the dirty flag always false. Thanks again, Jim ----- Original Message ----- From: Doreen Greaves <[EILLAG--worldnet--att--net]> To: <[rebol-list--rebol--com]> Sent: Wednesday, June 26, 2002 7:51 PM Subject: [REBOL] editor
> this is a hack: > <code> > REBOL [ > title: "example" > file: %example.r > date: "24-Jun-2002/21:37:47-7:00" > comment: {paste to a window at caret position > } > ] > paste: func [ > "pastes to caret" > ][ > if not equal? system/view/focal-face a1 [focus a1] > if not series? system/view/caret [ > system/view/caret: offset-to-caret a1 caret-xy > ] > if series? system/view/caret [ > insert system/view/caret copy b1/text > ] > system/view/caret: skip system/view/caret length? b1/text > show a1 > ] > main: layout[ > text "timer hanger" rate .1 feel[ > engage: func [face action event][ > caret-xy: caret-to-offset a1 system/view/caret > ] > ] > b1: button "paste" [paste] > b2: button "open" [a1/text: read to-file request-file show a1] > a1: area "" > return > my-slider: slider [scroll-para a1 my-slider] > ] > focus a1 > system/view/caret: head a1/text > view main > <code> > Gabrielle's post got me to thinking. I tried months ago to get > this to work for at least 40 hours. all I could do is paste > at the position of the click when the other way failed. > the caret disappears so you need to put it back where it was. > timer hanger does nothing so redefining its feel wont break any other
> it saves the caret position in caret-xy. (line 25) > then in line 14 you put it back. > there may be a problem with fast entrys. the rate (line 23) > can be made faster or use > if error? try [this][too bad-do this] > to avoid crashing. > > now you need to update the slider in the timer hanger so > when you show the field it doesen't reset at the beginning. > search the list for update-slider.r, I think. > use copy. see the list and rebolforces for more info. > text: a1/text IS a1/text > but > text: copy a1/text is not. > > caret-to-offset face object! offset STRING! > offset-to-caret face object! offset PAIR! > confused? i sure was. Rebol is frustrating and > (I think) getting too complicated and ahead of itself. > > Gabrielle's post gave me the hint I needed. > I have struggled with this fix since december. > I paint houses for a living and > this is my first post and e-mail. > i will unsuscribe when finished but > will continue to follow the list. > > thanks to all for the brain exersize. > please remember that people like us are > interested. discussion is good, code is > better (even eye candy, although it does not display too > good on win 95 256color) and explained code is great. > > -- > To unsubscribe from this list, please send an email to > [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes. >
-- Binary/unsupported file stripped by Listar -- -- Type: application/octet-stream -- File: Show Desktop.scf