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

[REBOL] Re: Switching images

From: petr:krenzelok:trz:cz at: 11-May-2001 16:18

Ross and Ruth Marsden wrote:
> REBOL [] > > images: [ %/c/ensemble/500hPa_height/m500z_f000_shbg_20010504.gif > %/c/ensemble/500hPa_height/m500z_f024_shbg_20010504.gif > %/c/ensemble/500hPa_height/m500z_f048_shbg_20010504.gif > %/c/ensemble/500hPa_height/m500z_f072_shbg_20010504.gif > %/c/ensemble/500hPa_height/m500z_f096_shbg_20010504.gif > %/c/ensemble/500hPa_height/m500z_f120_shbg_20010504.gif > ] > > view layout [ > vh2 "Looper" > theimage: image [images first] 300x350 >
hmm, I am not sure you can use it that way ... 1) you are using incorrect function ordering - first images is the way ... not images first ... 2) try image images/1
> across > button "Prev" [theimage/image: [images back] show theimage] > button "Next" [theimage/image: [images next] show theimage] >
ha ... the same goes here ... back images, next images .. not in reverse ... however: - style action code enclosed in [] should contain rebol code .... no need for other data block (in your case [images back]) - try: button "Prev" [theimage/image: load first images: next images show theimage] button "Next" [theimage/image: load first images: back images show theimage] ... hmm, but what happens once we reach end of block? :-) Script will crash ... you would have to set more appropriate scheme :-) btw: look at cyphre's reb-site (via Rebol desktop)- there is image viewer already done :-) (right-click to get its's source)
> button "Quit" [quit] > return > name: text "Merlot" 100x30 > button "Change" [name/text: "Cabernet" show name] > ] > ;> 1) In <theimage: image [images first] 300x350>, if <[images first]> is > replaced by <images/1>, the first image is displayed. YeeHa! > But, what's wrong with <images first>? >
look above - word ordering - first images, not images first
> 2) The two lines > name: text "Merlot" 100x30 > button "Change" [name/text: "Cabernet" show name] > are to show that this general technique of using a button action to change > the content of a face does work (as suggested in the REBOL/View > documentation HTML page). > That being the case, what is wrong with the lines > button "Prev" [theimage/image: [images back] show theimage] > button "Next" [theimage/image: [images next] show theimage] >
- the same - word ordering ...
> 3) I also tried a placing the button actions in functions like > previmage: does [theimage/image: [images back] show theimage] > but that does not work either. The functions would eventually check > for the current image being the first or last and do something sensible. > > 4) What about <button "Quit" [quit]>? What is the command to close the > REBOL/View child window created by <view layout [faces]> but leave > the REBOL/View console and or Desktop running.
try: [unview]
> Is there a command that can be issued from the console to kill a > REVOL/View app window?
look above - the function is called: unview
> Thanks in advance... Sorry about the length for a first post :-[
not a problem, we can read :-) Cheers, -pekr-