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

View/Draw'ing with 'size...

 [1/6] from: media:quazart at: 22-Oct-2001 13:47


Hi I am starting to delve deeply into the depts of View and have come to realize that its actually easier to build dynamic Views using panes and faces directly instead of using VID. but When creating the button panels, it still is easier to make use of VID. There is one difference I have found, and this will be a teaser for the 'binding experts I think If you run the following snippet: rebol [] q-style: stylize [ qbutton: box 100x100 effect [ tile contrast 10 gradmul 0x1 120.120.120 80.80.80 draw [pen 0.0.255 box 0x0 size] ] ] view layout [styles q-style qbutton "HEY!"] You will notice that at the time of running, There seems to be a problem where size does not exist within the draw block... in a sense its normal... Thus I cannot modify my button's edge looks this way... I guess it is not bound to the face it (eventually) creates... BUT if I set the size within draw block directly by creating a pane face like this: rebol [] time-pane: make face [ color: none size: 100x100 offset: 30x30 pane: [] edge: none effect: [draw [pen 255.0.0 line 0x0 size]] ] view time-pane you will notice that it DOES recognize the size... If you print the code, they both reference size. NOW THE QUESTION: ----------------------------------- How can my draw block have its context (binding) set to the pane object as in the second code example while creating stylesheets? -Max ------------------------------------ Maxim Olivier-Adlhoch Technical Director Quaz'Art

 [2/6] from: chris:ross-gill at: 22-Oct-2001 14:17


Hi Max,
> rebol [] > q-style: stylize [
<<quoted lines omitted: 6>>
> ] > view layout [styles q-style qbutton "HEY!"]
...
> NOW THE QUESTION: > ----------------------------------- > > How can my draw block have its context (binding) set to the pane object as > in the second code example while creating stylesheets?
If you change it to face/size, does that work as intended? - Chris -- rebol [] q-style: stylize [ qbutton: box 100x100 effect [ tile contrast 10 gradmul 0x1 120.120.120 80.80.80 draw [pen 0.0.255 box 0x0 face/size] ] ] view layout [styles q-style qbutton "HEY!"]

 [3/6] from: media::quazart::com at: 22-Oct-2001 14:48


Yep! funny... I -KNOW- I tried it! I Guess something Else was interfering at the time. thanks, -Max

 [4/6] from: media:quazart at: 22-Oct-2001 15:15


Hi Chriss, ALAS... I just discovered that specifying face/size, references a static context... the context of the object from which the current object will be built... test this: rebol [] q-style: stylize [ qbutton: box 120x120 effect [ tile contrast 10 gradmul 0x1 120.120.120 80.80.80 draw [pen 0.0.255 box 0x0 face/size - 1x1] ] ] view layout [styles q-style qbutton "HEY!"] You should see that face is refering to the default box face object... not to this new "instance" of box . any other ideas? -Max

 [5/6] from: allenk:powerup:au at: 23-Oct-2001 6:41


----- Original Message ----- From: "Media" <[media--quazart--com]> To: "reblist" <[rebol-list--rebol--com]> Sent: Tuesday, October 23, 2001 3:47 AM Subject: [REBOL] View/Draw'ing with 'size...
> Hi I am starting to delve deeply into the depts of View and have come to
realize that its actually easier to build dynamic Views using panes and faces directly instead of using VID.
> but When creating the button panels, it still is easier to make use of
VID. There is one difference I have found, and this will be a teaser for the 'binding experts I think
> If you run the following snippet: > rebol []
<<quoted lines omitted: 8>>
> view layout [styles q-style qbutton "HEY!"] > You will notice that at the time of running, There seems to be a problem
where size does not exist within the draw block... in a sense its normal...
> Thus I cannot modify my button's edge looks this way... I guess it is not
bound to the face it (eventually) creates... Using with in the stylize dialect allows you to build a style more face like way. It gives you the best of both worlds. (FACE + VID) e.g q-style: stylize [ qbutton: box 100x100 with [ effect: [ tile contrast 10 gradmul 0x1 120.120.120 80.80.80 draw [pen 0.0.255 box 0x0 size] ] ] ] Cheers, Allen K

 [6/6] from: media:quazart at: 23-Oct-2001 8:45


Hi Allen. Well, that does the trick! Funny that I did do some tests using "with" but I don't remember exactly how, cause at the time it didn't work ... I must have tried about 20 variations in total (hell I even tried usign the ol' "repend" trick!)... Sometimes in rebol knowing the path is less important than knowing where to thread on it! There are many different variations and even if I have been programing exclusively in rebol for the last 2 years, I still discover new tricks daily! (and forget as many too :-( thanks! -Max

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted