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

[REBOL] VID, layout, DO, init, hide, show === ISSUE + BYPASS THE ISSUE

From: rebol:meurrens at: 26-May-2003 17:45

Hello, You known perhaps that there is a DO functionnality that can be used in a layout definition. As far as I know (???) this functionnality is not documented except in Olivier Auverlot's book and on the page http://www.codeconscious.com/rebol/view-notes.html It seems that the function is called BEFORE showing all the faces of your layout. Thus if you want to decide, within a DO block, which faces you want to show or to hide, depending upon your data, you have a problem !!! All faces will, later on, be shown. Even, for instance, buttons providing an unavailable functionnality, etc. :-( Everything, including an easy way (but somewhat tricky...) to bypass the issue, is explained by running the small script below (just cut & paste in your editor and REBOL it.) HTH It may be a nice feature to have a set of similar functionnalities for doing something at the different steps of the life of the layout (such as just before showing, just after showing, when closed, etc...) May be somebody here may have another solution such as capturing some events, etc ??? I already found on the web how to capture the closing of the window. But, may be there is a general and smart solution somewhere ??? </marc> ;;;;;;;;;;;;;;;;;;;;;;;; ====================================== REBOL [] bad: [ banner 100x50 "Issue" yes-1: button 200x30 "Yes, I must be here" [ unview ] no-1: button red 200x30 "No, I may not be here" [ unview ] area 400x300 { bad: [ banner 100x50 "Issue" yes-1: button 200x30 "Yes, I must be here" [ unview ] no-1: button red 200x30 "No, I may not be here" [ unview ] area 400x300 { ... } do [ hide no-1 ;;;; will show up !!! ] ] } do [ hide no-1 ;;;; will show up !!! ] ] good: [ banner 100x50 "Bypass" yes-2: button 200x30 "Yes, I must be here" [ unview ] no-2: button red 200x30 "No, I may not be here" [ unview ] area 400x300 { good: [ banner 100x50 "Issue" yes-2: button 200x30 "Yes, I must be here" [ unview ] no-2: button red 200x30 "No, I may not be here" [ unview ] area 400x300 { ... } rate 00:00:00 feel [ engage: function [ f a e ][] [ f/rate: none show f ;;;;;;;;;;; DO NOT FORGET TO UPDATE THE rate !!!! hide no-2 ;;;; will NOT show up !!! ] ] ] } rate 00:00:00 feel [ engage: function [ f a e ][] [ f/rate: none show f hide no-2 ;;;; will NOT show up !!! ] ] ] view layout [ banner "VID issue and bypass" button 100x40 red bold 12 "issue" [ view/new/offset layout bad 50x50 ] button 100x40 green bold 12 "bypass" [ view/new/offset layout good 50x50 ] ] ;;;;;;;;;;; =============================================== Prof. Ir Marc Meurrens, Brussels (be) TEL: +32 (0)2 537 2812 FAX: +32 (0)2 537 7645 EMAIL: [marc--meurrens--org] URL: http://www.meurrens.org/ REB: http://rebol.mksa.net/ PGPKEY: http://www.meurrens.org/pgp/ Please don't mail me attached files, instead, use my 'exchange area' : EXCHANGE AREA: http://www.meurrens.org/exchange/ (HTTP/FTP upload/download of temporary/persistent files)