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

[REBOL] Re: text-list questions (probably answered before)

From: peoyli:algonet:se at: 17-Apr-2001 19:48

> > From: "P-O Yliniemi" > > > Here is a collection of text-list related problems I have gotten so > > > far: > > > > > > 1. how do I set the slider to the 'correct' position on a rebuild ? > >
ah.. almost there (by poking around in the text-list object).. now.. how do stop the slider knob from jumping from the top of the container to the position I want it in ? The value I poke at is: tl/sld/pane/offset where 'tl' is my text-list in the layout. I want the initial position to be set to the old position.. [ REBOL [] list-items: {some items to play around with in the list. Specific problems I have is all related to rebuilding the list} list-block: parse list-items " " build-layout: func [ {Build the test layout} ][ l: layout [ tl: text-list 100x140 data list-block [ if not none? tl/picked [ print first tl/picked ] print tl/sld/pane/offset ] button "Rebuild" [ old-picked: tl/picked ; save old selection old-sn: tl/sn ; save old visible area old-sld-offset: tl/sld/pane/offset build-layout ; rebuild tl/picked: old-picked ; initial selection is what was before tl/sn: old-sn ; make what was visible before visible again view center-face l ; view the layout tl/sld/pane/offset: old-sld-offset show tl ] ] ] build-layout view center-face l ] /PeO