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

[REBOL] Re: Little questions, big answers...

From: carl:cybercraft at: 5-Sep-2001 8:39

On 05-Sep-01, David Ness wrote:
> Although I have considerable experience across a wide range of > programming languages, REBOL is different enough that learning it is > a challenge. So far it has been a very productive and worthwhile > challenge, but `hard' nonetheless. > I have a few small fragments of code that > (a) work; and > (b) I don't understand at all (having cribbed them from some > piece or other of working code). I have the feeling that if I could > gradually understand them, I'd learn something about REBOL. > Here's an example. I have > dex-pane1: layout/offset [ > origin 0 space 2x0 across > styles dex-styles > label right "IP Address" 200x24 bold middle font-size 16 > return > IP-1: fld right return > IP-2: fld right return > IP-3: fld right return > IP-4: fld right return > IP-5: fld right return > ] 0x0 > which produces a panel in a display of IP addresses and Machine > names. > What I am unclear about is at least: > (1) what _are_ `IP-1' ... here inside the layout. Are they > `objects' created by this declaration?
They're variables referencing the fld objects.
> (2) Is there some way I can `dump' `IP-n' to take a look at what > they are;
Yes, but there's a lot to them. For instance...
>> view layout [IP-6: field "Hello"]
gives you a field which I assume is much like in your example. Now, to see all the variable names in the field object, enter the following at the Console (after you've closed the window created by the above) ...
>> probe first ip-6
(Don't enter just "probe ip-6" though, as REBOL will go away for a very long time...) This gives you... [self type offset size span pane text color image effect data edge font para feel saved-area rate show? options parent-face old-offset old-size line-list changes face-flags action state style alt-action facets related words colors texts file var keycode reset styles init multi blinker pane-size dirty? help user-data flags] These can be accessed thus...
>> ip-6/text
== "Hello"
>> ip-6/size
== 200x24
>> ip-6/colors
== [240.240.240 255.255.100] and so on. The following uses the ip-6 vaiable to clear the field's text by clicking on a button. view layout [IP-6: field "Hello" button "Clear" [clear ip-6/text show ip-6]] Hope this helps. Others will be better qualified to answer the next question. (We're mostly all learners when it comes to View/VID.:)
> (3) My display obviously is `wired' to display 5 addresses. How > would one normally generalize this. > Although detailed programming advice is always welcome, I am more > looking for (a few) words about what is really `going on' in > something like this `layout' declaration, if that can be answered in > less than a long epistle.
-- Carl Read